Search in sources :

Example 1 with GroupByExecutor

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());
}
Also used : ExecutionStatistics(com.linkedin.pinot.core.operator.ExecutionStatistics) TransformBlock(com.linkedin.pinot.core.operator.blocks.TransformBlock) DefaultGroupByExecutor(com.linkedin.pinot.core.query.aggregation.groupby.DefaultGroupByExecutor) IntermediateResultsBlock(com.linkedin.pinot.core.operator.blocks.IntermediateResultsBlock) GroupByExecutor(com.linkedin.pinot.core.query.aggregation.groupby.GroupByExecutor) DefaultGroupByExecutor(com.linkedin.pinot.core.query.aggregation.groupby.DefaultGroupByExecutor)

Aggregations

ExecutionStatistics (com.linkedin.pinot.core.operator.ExecutionStatistics)1 IntermediateResultsBlock (com.linkedin.pinot.core.operator.blocks.IntermediateResultsBlock)1 TransformBlock (com.linkedin.pinot.core.operator.blocks.TransformBlock)1 DefaultGroupByExecutor (com.linkedin.pinot.core.query.aggregation.groupby.DefaultGroupByExecutor)1 GroupByExecutor (com.linkedin.pinot.core.query.aggregation.groupby.GroupByExecutor)1