use of com.linkedin.pinot.core.query.aggregation.groupby.GroupByExecutor in project pinot by linkedin.
the class AggregationGroupByOperator method getNextBlock.
@Override
public Block getNextBlock() {
int numDocsScanned = 0;
// Perform aggregation group-by on all the blocks.
GroupByExecutor groupByExecutor = new DefaultGroupByExecutor(_aggregationFunctionContexts, _groupBy, _numGroupsLimit);
groupByExecutor.init();
TransformBlock transformBlock;
while ((transformBlock = (TransformBlock) _transformOperator.nextBlock()) != null) {
numDocsScanned += transformBlock.getNumDocs();
groupByExecutor.process(transformBlock);
}
groupByExecutor.finish();
// Create execution statistics.
long numEntriesScannedInFilter = _transformOperator.getExecutionStatistics().getNumEntriesScannedInFilter();
long numEntriesScannedPostFilter = numDocsScanned * _transformOperator.getNumProjectionColumns();
_executionStatistics = new ExecutionStatistics(numDocsScanned, numEntriesScannedInFilter, numEntriesScannedPostFilter, _numTotalRawDocs);
// Build intermediate result block based on aggregation group-by result from the executor.
return new IntermediateResultsBlock(_aggregationFunctionContexts, groupByExecutor.getResult());
}
Aggregations