Class PruneGroupIdColumns
java.lang.Object
io.trino.sql.planner.iterative.rule.ProjectOffPushDownRule<GroupIdNode>
io.trino.sql.planner.iterative.rule.PruneGroupIdColumns
- All Implemented Interfaces:
Rule<ProjectNode>
This rule prunes GroupIdNode's aggregationArguments.
Transforms:
- Project (a, key_1, key_2, group_id)
- GroupId
grouping sets: ((key_1), (key_2))
aggregation arguments: (a, b)
group id symbol: group_id
- Source (a, b, key_1, key_2)
Into:
- Project (a, key_1, key_2, group_id)
- GroupId
grouping sets: ((key_1), (key_2))
aggregation arguments: (a)
group id symbol: group_id
- Source (a, b, key_1, key_2)
Note: this rule does not prune any grouping symbols.
Currently, GroupIdNode is only used in regard to AggregationNode.
The presence of an AggregationNode in the plan ensures that
the grouping symbols are referenced.
This rule could be extended to prune grouping symbols.
Note: after pruning an aggregation argument, the child node of the GroupIdNode becomes eligible for symbol pruning. That is performed by the rule PruneGroupIdSourceColumns.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionpushDownProjectOff(Rule.Context context, GroupIdNode groupIdNode, Set<Symbol> referencedOutputs) Methods inherited from class io.trino.sql.planner.iterative.rule.ProjectOffPushDownRule
apply, getPattern
-
Constructor Details
-
PruneGroupIdColumns
public PruneGroupIdColumns()
-
-
Method Details
-
pushDownProjectOff
protected Optional<PlanNode> pushDownProjectOff(Rule.Context context, GroupIdNode groupIdNode, Set<Symbol> referencedOutputs) - Specified by:
pushDownProjectOffin classProjectOffPushDownRule<GroupIdNode>
-