Class EnumerableAggregate
- java.lang.Object
-
- org.apache.calcite.rel.AbstractRelNode
-
- org.apache.calcite.rel.SingleRel
-
- org.apache.calcite.rel.core.Aggregate
-
- org.apache.calcite.adapter.enumerable.EnumerableAggregate
-
- All Implemented Interfaces:
java.lang.Cloneable
,EnumerableRel
,RelOptNode
,RelNode
public class EnumerableAggregate extends Aggregate implements EnumerableRel
Implementation ofAggregate
inenumerable calling convention
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
EnumerableAggregate.AggContextImpl
An implementation ofAggContext
.-
Nested classes/interfaces inherited from class org.apache.calcite.rel.core.Aggregate
Aggregate.AggCallBinding, Aggregate.Group
-
Nested classes/interfaces inherited from interface org.apache.calcite.adapter.enumerable.EnumerableRel
EnumerableRel.Prefer, EnumerableRel.Result
-
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, indicator, IS_NOT_GRAND_TOTAL, IS_SIMPLE, NO_INDICATOR
-
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
Fields inherited from interface org.apache.calcite.adapter.enumerable.EnumerableRel
FILTER_FACTORY, PROJECT_FACTORY
-
-
Constructor Summary
Constructors Constructor Description EnumerableAggregate(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, boolean indicator, ImmutableBitSet groupSet, java.util.List<ImmutableBitSet> groupSets, java.util.List<AggregateCall> aggCalls)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EnumerableAggregate
copy(RelTraitSet traitSet, RelNode input, boolean indicator, ImmutableBitSet groupSet, java.util.List<ImmutableBitSet> groupSets, java.util.List<AggregateCall> aggCalls)
Creates a copy of this aggregate.private void
declareParentAccumulator(java.util.List<Expression> initExpressions, BlockBuilder initBlock, PhysType accPhysType)
private static boolean
hasOrderedCall(java.util.List<AggImpState> aggs)
EnumerableRel.Result
implement(EnumerableRelImplementor implementor, EnumerableRel.Prefer pref)
Creates a plan for this expression according to a calling convention.private void
implementLambdaFactory(BlockBuilder builder, PhysType inputPhysType, java.util.List<AggImpState> aggs, Expression accumulatorInitializer, boolean hasOrderedCall, ParameterExpression lambdaFactory)
Implements theAggregateLambdaFactory
.-
Methods inherited from class org.apache.calcite.rel.core.Aggregate
computeSelfCost, containsDistinctCall, copy, deriveRowType, deriveRowType, estimateRowCount, explainTerms, getAggCallList, getGroupCount, getGroupSet, getGroupSets, getGroupType, 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, computeDigest, computeSelfCost, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.calcite.rel.RelNode
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, computeSelfCost, copy, estimateRowCount, explain, getChildExps, getCollationList, getConvention, getCorrelVariable, getExpectedInputRowType, getInput, getInputs, getQuery, getRelTypeName, getRows, getRowType, getTable, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, replaceInput
-
Methods inherited from interface org.apache.calcite.plan.RelOptNode
getCluster, getDescription, getDigest, getId, getTraitSet
-
-
-
-
Constructor Detail
-
EnumerableAggregate
public EnumerableAggregate(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, boolean indicator, ImmutableBitSet groupSet, java.util.List<ImmutableBitSet> groupSets, java.util.List<AggregateCall> aggCalls) throws InvalidRelException
- Throws:
InvalidRelException
-
-
Method Detail
-
copy
public EnumerableAggregate copy(RelTraitSet traitSet, RelNode input, boolean indicator, ImmutableBitSet groupSet, java.util.List<ImmutableBitSet> groupSets, java.util.List<AggregateCall> aggCalls)
Description copied from class:Aggregate
Creates a copy of this aggregate.- Specified by:
copy
in classAggregate
- Parameters:
traitSet
- Traitsinput
- Inputindicator
- Whether row type should include indicator fields to indicate which grouping set is active; must be true if aggregate is not simplegroupSet
- Bit set of grouping fieldsgroupSets
- List of all grouping sets; null for justgroupSet
aggCalls
- Collection of calls to aggregate functions- Returns:
- New
Aggregate
if any parameter differs from the value of thisAggregate
, or justthis
if all the parameters are the same - See Also:
Aggregate.copy(org.apache.calcite.plan.RelTraitSet, java.util.List)
-
implement
public EnumerableRel.Result implement(EnumerableRelImplementor implementor, EnumerableRel.Prefer pref)
Description copied from interface:EnumerableRel
Creates a plan for this expression according to a calling convention.- Specified by:
implement
in interfaceEnumerableRel
- Parameters:
implementor
- Implementorpref
- Preferred representation for rows in result expression- Returns:
- Plan for this expression according to a calling convention
-
hasOrderedCall
private static boolean hasOrderedCall(java.util.List<AggImpState> aggs)
-
declareParentAccumulator
private void declareParentAccumulator(java.util.List<Expression> initExpressions, BlockBuilder initBlock, PhysType accPhysType)
-
implementLambdaFactory
private void implementLambdaFactory(BlockBuilder builder, PhysType inputPhysType, java.util.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 useOrderedAggregateLambdaFactory
implementation to implement sorted aggregates for that.hasOrderedCall == false
indicates to useSequencedAdderAggregateLambdaFactory
to implement a non-sort aggregate.
-
-