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
public final class LogicalAggregate extends Aggregate
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
-
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
-
Constructor Summary
Constructors Constructor Description LogicalAggregate(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, ImmutableBitSet groupSet, 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 Type Method Description RelNode
accept(RelShuttle shuttle)
Accepts a visit from a shuttle.LogicalAggregate
copy(RelTraitSet traitSet, RelNode input, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls)
Creates a copy of this aggregate.static LogicalAggregate
create(RelNode input, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls)
Deprecated.static LogicalAggregate
create(RelNode input, List<RelHint> hints, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls)
Creates a LogicalAggregate.static LogicalAggregate
create(RelNode input, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls)
Deprecated.RelNode
withHints(List<RelHint> hintList)
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, noIndicator
Methods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, getInput, getInputs, replaceInput
Methods 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, toString
-
Constructor Details
-
LogicalAggregate
public LogicalAggregate(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, ImmutableBitSet groupSet, 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 justgroupSet
aggCalls
- 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, 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, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls)Description copied from class:Aggregate
Creates a copy of this aggregate.- Specified by:
copy
in classAggregate
- Parameters:
traitSet
- Traitsinput
- InputgroupSet
- 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)
-
accept
Description copied from interface:RelNode
Accepts a visit from a shuttle.- Specified by:
accept
in interfaceRelNode
- Overrides:
accept
in 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:Hintable
Returns 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
-