Class PruneGroupIdColumns
- java.lang.Object
-
- io.prestosql.sql.planner.iterative.rule.ProjectOffPushDownRule<GroupIdNode>
-
- io.prestosql.sql.planner.iterative.rule.PruneGroupIdColumns
-
- All Implemented Interfaces:
Rule<ProjectNode>
public class PruneGroupIdColumns extends ProjectOffPushDownRule<GroupIdNode>
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.prestosql.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Constructor Summary
Constructors Constructor Description PruneGroupIdColumns()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Optional<PlanNode>
pushDownProjectOff(Rule.Context context, GroupIdNode groupIdNode, Set<Symbol> referencedOutputs)
-
Methods inherited from class io.prestosql.sql.planner.iterative.rule.ProjectOffPushDownRule
apply, getPattern
-
-
-
-
Method Detail
-
pushDownProjectOff
protected Optional<PlanNode> pushDownProjectOff(Rule.Context context, GroupIdNode groupIdNode, Set<Symbol> referencedOutputs)
- Specified by:
pushDownProjectOff
in classProjectOffPushDownRule<GroupIdNode>
-
-