Class AggregateOperator
- java.lang.Object
-
- org.apache.pinot.query.runtime.operator.MultiStageOperator
-
- org.apache.pinot.query.runtime.operator.AggregateOperator
-
- All Implemented Interfaces:
AutoCloseable,Operator<TransferableBlock>
public class AggregateOperator extends MultiStageOperator
AggregateOperator is used to aggregate values over a set of group by keys. Output data will be in the format of [group by key, aggregate result1, ... aggregate resultN] Currently, we only support the following aggregation functions: 1. SUM 2. COUNT 3. MIN 4. MAX 5. DistinctCount and Count(Distinct) 6. AVG 7. FourthMoment 8. BoolAnd and BoolOr When the list of aggregation calls is empty, this class is used to calculate distinct result based on group by keys. In this case, the input can be any type. If the list of aggregation calls is not empty, the input of aggregation has to be a number. Note: This class performs aggregation over the double value of input. If the input is single value, the output type will be input type. Otherwise, the output type will be double.
-
-
Field Summary
-
Fields inherited from class org.apache.pinot.query.runtime.operator.MultiStageOperator
_context, _opChainStats, _operatorId
-
-
Constructor Summary
Constructors Constructor Description AggregateOperator(OpChainExecutionContext context, MultiStageOperator inputOperator, DataSchema resultSchema, DataSchema inputSchema, List<RexExpression> aggCalls, List<RexExpression> groupSet, AggregateNode.AggType aggType, List<Integer> filterArgIndices, AbstractPlanNode.NodeHint nodeHint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<MultiStageOperator>getChildOperators()protected TransferableBlockgetNextBlock()StringtoExplainString()-
Methods inherited from class org.apache.pinot.query.runtime.operator.MultiStageOperator
cancel, close, getOperatorId, nextBlock, shouldCollectStats
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pinot.core.common.Operator
explainPlan, getExecutionStatistics, getIndexSegment, prepareForExplainPlan
-
-
-
-
Constructor Detail
-
AggregateOperator
public AggregateOperator(OpChainExecutionContext context, MultiStageOperator inputOperator, DataSchema resultSchema, DataSchema inputSchema, List<RexExpression> aggCalls, List<RexExpression> groupSet, AggregateNode.AggType aggType, @Nullable List<Integer> filterArgIndices, @Nullable AbstractPlanNode.NodeHint nodeHint)
-
-
Method Detail
-
getChildOperators
public List<MultiStageOperator> getChildOperators()
- Specified by:
getChildOperatorsin interfaceOperator<TransferableBlock>- Overrides:
getChildOperatorsin classMultiStageOperator
-
toExplainString
@Nullable public String toExplainString()
-
getNextBlock
protected TransferableBlock getNextBlock()
- Specified by:
getNextBlockin classMultiStageOperator
-
-