Package org.apache.calcite.rel.logical
Class LogicalAggregate
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.SingleRel
org.apache.calcite.rel.core.Aggregate
org.apache.calcite.rel.logical.LogicalAggregate
- All Implemented Interfaces:
Cloneable,RelOptNode,Hintable,RelNode
LogicalAggregate is a relational operator which eliminates
duplicates and computes totals.
Rules:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.calcite.rel.core.Aggregate
Aggregate.AggCallBinding, Aggregate.Group, Aggregate.PercentileDiscAggCallBindingNested 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_INDICATORFields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet -
Constructor Summary
ConstructorsConstructorDescriptionLogicalAggregate(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, ImmutableBitSet groupSet, @Nullable List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Creates a LogicalAggregate.LogicalAggregate(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Deprecated.LogicalAggregate(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Deprecated.LogicalAggregate(RelOptCluster cluster, RelNode input, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Deprecated.LogicalAggregate(RelInput input) Creates a LogicalAggregate by parsing serialized output. -
Method Summary
Modifier and TypeMethodDescriptionaccept(RelShuttle shuttle) Accepts a visit from a shuttle.copy(RelTraitSet traitSet, RelNode input, ImmutableBitSet groupSet, @Nullable List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Creates a copy of this aggregate.static LogicalAggregatecreate(RelNode input, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Deprecated.static LogicalAggregatecreate(RelNode input, List<RelHint> hints, ImmutableBitSet groupSet, @Nullable List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Creates a LogicalAggregate.static LogicalAggregatecreate(RelNode input, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Deprecated.Returns a new relational expression with the specified hintshintList.Methods inherited from class org.apache.calcite.rel.core.Aggregate
checkIndicator, computeSelfCost, containsDistinctCall, copy, copy, deriveRowType, deriveRowType, estimateRowCount, explainTerms, getAggCallList, getGroupCount, getGroupSet, getGroupSets, getGroupType, getHints, getIndicatorCount, getNamedAggCalls, isNotGrandTotal, isSimple, isValid, noIndicatorMethods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, getInput, getInputs, replaceInputMethods inherited from class org.apache.calcite.rel.AbstractRelNode
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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.rel.hint.Hintable
attachHintsMethods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Constructor Details
-
LogicalAggregate
public LogicalAggregate(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, ImmutableBitSet groupSet, @Nullable List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Creates a LogicalAggregate.Use
create(org.apache.calcite.rel.RelNode, java.util.List<org.apache.calcite.rel.hint.RelHint>, org.apache.calcite.util.ImmutableBitSet, java.util.List<org.apache.calcite.util.ImmutableBitSet>, java.util.List<org.apache.calcite.rel.core.AggregateCall>)unless you know what you're doing.- Parameters:
cluster- Cluster that this relational expression belongs totraitSet- Traitshints- Hints for this relational expressioninput- Input relational expressiongroupSet- Bit set of grouping fieldsgroupSets- Grouping sets, or null to use justgroupSetaggCalls- Array of aggregates to compute, not null
-
LogicalAggregate
@Deprecated public LogicalAggregate(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Deprecated. -
LogicalAggregate
@Deprecated public LogicalAggregate(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Deprecated. -
LogicalAggregate
@Deprecated public LogicalAggregate(RelOptCluster cluster, RelNode input, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Deprecated. -
LogicalAggregate
Creates a LogicalAggregate by parsing serialized output.
-
-
Method Details
-
create
public static LogicalAggregate create(RelNode input, List<RelHint> hints, ImmutableBitSet groupSet, @Nullable List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Creates a LogicalAggregate. -
create
@Deprecated public static LogicalAggregate create(RelNode input, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Deprecated. -
create
@Deprecated public static LogicalAggregate create(RelNode input, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Deprecated. -
copy
public LogicalAggregate copy(RelTraitSet traitSet, RelNode input, ImmutableBitSet groupSet, @Nullable List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) Description copied from class:AggregateCreates a copy of this aggregate.- Specified by:
copyin classAggregate- Parameters:
traitSet- Traitsinput- InputgroupSet- Bit set of grouping fieldsgroupSets- List of all grouping sets; null for justgroupSetaggCalls- Collection of calls to aggregate functions- Returns:
- New
Aggregateif any parameter differs from the value of thisAggregate, or justthisif all the parameters are the same - See Also:
-
accept
Description copied from interface:RelNodeAccepts a visit from a shuttle.- Specified by:
acceptin interfaceRelNode- Overrides:
acceptin classAbstractRelNode- Parameters:
shuttle- Shuttle- Returns:
- A copy of this node incorporating changes made by the shuttle to this node's children
-
withHints
Description copied from interface:HintableReturns a new relational expression with the specified hintshintList.This method should be overridden by every logical node that supports hint. It is only for internal use during decorrelation.
Sub-class should return a new copy of the relational expression.
The default implementation returns the relational expression directly only because not every kind of relational expression supports hints.
- Returns:
- Relational expression with set up hints
-