Package io.trino.sql.planner.plan
Class AggregationNode
java.lang.Object
io.trino.sql.planner.plan.PlanNode
io.trino.sql.planner.plan.AggregationNode
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionAggregationNode(PlanNodeId id, PlanNode source, Map<Symbol, AggregationNode.Aggregation> aggregations, AggregationNode.GroupingSetDescriptor groupingSets, List<Symbol> preGroupedSymbols, AggregationNode.Step step, Optional<Symbol> hashSymbol, Optional<Symbol> groupIdSymbol) -
Method Summary
Modifier and TypeMethodDescription<R,C> R accept(PlanVisitor<R, C> visitor, C context) static AggregationNode.BuilderbuilderFrom(AggregationNode node) intgetStep()groupingSets(List<Symbol> groupingKeys, int groupingSetCount, Set<Integer> globalGroupingSets) booleanbooleanbooleanbooleanbooleanbooleanhasSingleNodeExecutionPreference(Session session, Metadata metadata) booleanisDecomposable(Session session, Metadata metadata) booleanbooleanreplaceChildren(List<PlanNode> newChildren) static AggregationNodesingleAggregation(PlanNodeId id, PlanNode source, Map<Symbol, AggregationNode.Aggregation> aggregations, AggregationNode.GroupingSetDescriptor groupingSets) singleGroupingSet(List<Symbol> groupingKeys)
-
Constructor Details
-
AggregationNode
public AggregationNode(PlanNodeId id, PlanNode source, Map<Symbol, AggregationNode.Aggregation> aggregations, AggregationNode.GroupingSetDescriptor groupingSets, List<Symbol> preGroupedSymbols, AggregationNode.Step step, Optional<Symbol> hashSymbol, Optional<Symbol> groupIdSymbol)
-
-
Method Details
-
singleAggregation
public static AggregationNode singleAggregation(PlanNodeId id, PlanNode source, Map<Symbol, AggregationNode.Aggregation> aggregations, AggregationNode.GroupingSetDescriptor groupingSets) -
getGroupingKeys
-
getGroupingSets
-
hasSingleGlobalAggregation
public boolean hasSingleGlobalAggregation()- Returns:
- true if the aggregation collapses all rows into a single global group (e.g., as a result of a GROUP BY () query). Otherwise, false.
-
hasDefaultOutput
public boolean hasDefaultOutput()- Returns:
- whether this node should produce default output in case of no input pages.
For example for query:
A default output of "0" is expected to be produced by FINAL aggregation operator.SELECT count(*) FROM nation WHERE nationkey < 0
-
hasEmptyGroupingSet
public boolean hasEmptyGroupingSet() -
hasNonEmptyGroupingSet
public boolean hasNonEmptyGroupingSet() -
getSources
- Specified by:
getSourcesin classPlanNode
-
getOutputSymbols
- Specified by:
getOutputSymbolsin classPlanNode
-
getAggregations
-
getPreGroupedSymbols
-
getGroupingSetCount
public int getGroupingSetCount() -
getGlobalGroupingSets
-
getSource
-
getStep
-
getHashSymbol
-
getGroupIdSymbol
-
hasOrderings
public boolean hasOrderings() -
accept
-
replaceChildren
- Specified by:
replaceChildrenin classPlanNode
-
producesDistinctRows
public boolean producesDistinctRows() -
isDecomposable
-
hasSingleNodeExecutionPreference
-
isStreamable
public boolean isStreamable() -
globalAggregation
-
singleGroupingSet
-
groupingSets
public static AggregationNode.GroupingSetDescriptor groupingSets(List<Symbol> groupingKeys, int groupingSetCount, Set<Integer> globalGroupingSets) -
builderFrom
-