use of org.apache.hyracks.dataflow.std.group.sort.ExternalSortGroupByRunMerger in project asterixdb by apache.
the class SortGroupbyTest method initial.
@Override
protected void initial(final IHyracksTaskContext ctx, int tableSize, final int numFrames) throws HyracksDataException {
builder = new ExternalSortGroupByRunGenerator(ctx, keyFields, inRecordDesc, numFrames, keyFields, normalizedKeyComputerFactory, comparatorFactories, partialAggrInState, outputRec, Algorithm.QUICK_SORT);
mergerOperator = new AbstractUnaryOutputSourceOperatorNodePushable() {
@Override
public void initialize() throws HyracksDataException {
List<GeneratedRunFileReader> runs = builder.getRuns();
ISorter sorter = builder.getSorter();
IBinaryComparator[] comparators = new IBinaryComparator[comparatorFactories.length];
for (int i = 0; i < comparatorFactories.length; ++i) {
comparators[i] = comparatorFactories[i].createBinaryComparator();
}
INormalizedKeyComputer nmkComputer = normalizedKeyComputerFactory == null ? null : normalizedKeyComputerFactory.createNormalizedKeyComputer();
AbstractExternalSortRunMerger merger = new ExternalSortGroupByRunMerger(ctx, sorter, runs, keyFields, inRecordDesc, outputRec, outputRec, numFrames, writer, keyFields, nmkComputer, comparators, partialAggrInState, finalAggrInState, true);
merger.process();
}
};
}
Aggregations