Class EnumerableAggregateBase
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.SingleRel
org.apache.calcite.rel.core.Aggregate
org.apache.calcite.adapter.enumerable.EnumerableAggregateBase
- All Implemented Interfaces:
Cloneable
,RelOptNode
,Hintable
,RelNode
- Direct Known Subclasses:
EnumerableAggregate
,EnumerableSortedAggregate
Base class for EnumerableAggregate and EnumerableSortedAggregate.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.calcite.rel.core.Aggregate
Aggregate.AggCallBinding, Aggregate.Group, Aggregate.PercentileDiscAggCallBinding
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
Field Summary
Fields inherited from class org.apache.calcite.rel.core.Aggregate
aggCalls, groupSet, groupSets, hints, indicator, IS_NOT_GRAND_TOTAL, IS_SIMPLE, NO_INDICATOR
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
Constructor Summary
ModifierConstructorDescriptionprotected
EnumerableAggregateBase
(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, ImmutableBitSet groupSet, @Nullable List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
createAccumulatorAdders
(ParameterExpression inParameter, List<AggImpState> aggs, PhysType accPhysType, ParameterExpression accExpr, PhysType inputPhysType, BlockBuilder builder, EnumerableRelImplementor implementor, JavaTypeFactory typeFactory) createAggStateTypes
(List<Expression> initExpressions, BlockBuilder initBlock, List<AggImpState> aggs, JavaTypeFactory typeFactory) protected void
declareParentAccumulator
(List<Expression> initExpressions, BlockBuilder initBlock, PhysType accPhysType) protected static boolean
hasOrderedCall
(List<AggImpState> aggs) protected void
implementLambdaFactory
(BlockBuilder builder, PhysType inputPhysType, List<AggImpState> aggs, Expression accumulatorInitializer, boolean hasOrderedCall, ParameterExpression lambdaFactory) Implements theAggregateLambdaFactory
.Methods inherited from class org.apache.calcite.rel.core.Aggregate
checkIndicator, computeSelfCost, containsDistinctCall, copy, copy, copy, deriveRowType, deriveRowType, estimateRowCount, explainTerms, getAggCallList, getGroupCount, getGroupSet, getGroupSets, getGroupType, getHints, getIndicatorCount, getNamedAggCalls, isNotGrandTotal, isSimple, isValid, noIndicator
Methods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, getInput, getInputs, replaceInput
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, accept, collectVariablesSet, collectVariablesUsed, deepEquals, deepHashCode, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, metadata, onRegister, recomputeDigest, register, sole, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.calcite.rel.hint.Hintable
attachHints, withHints
Methods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Constructor Details
-
EnumerableAggregateBase
protected EnumerableAggregateBase(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, ImmutableBitSet groupSet, @Nullable List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls)
-
-
Method Details
-
hasOrderedCall
-
declareParentAccumulator
protected void declareParentAccumulator(List<Expression> initExpressions, BlockBuilder initBlock, PhysType accPhysType) -
implementLambdaFactory
protected void implementLambdaFactory(BlockBuilder builder, PhysType inputPhysType, List<AggImpState> aggs, Expression accumulatorInitializer, boolean hasOrderedCall, ParameterExpression lambdaFactory) Implements theAggregateLambdaFactory
.Behavior depends upon ordering:
hasOrderedCall == true
means there is at least one aggregate call including sort spec. We useLazyAggregateLambdaFactory
implementation to implement sorted aggregates for that.hasOrderedCall == false
indicates to useBasicAggregateLambdaFactory
to implement a non-sort aggregate.
-
createAccumulatorAdders
protected void createAccumulatorAdders(ParameterExpression inParameter, List<AggImpState> aggs, PhysType accPhysType, ParameterExpression accExpr, PhysType inputPhysType, BlockBuilder builder, EnumerableRelImplementor implementor, JavaTypeFactory typeFactory) -
createAggStateTypes
protected List<Type> createAggStateTypes(List<Expression> initExpressions, BlockBuilder initBlock, List<AggImpState> aggs, JavaTypeFactory typeFactory)
-