Class PruneUnnestColumns
- java.lang.Object
-
- io.prestosql.sql.planner.iterative.rule.ProjectOffPushDownRule<UnnestNode>
-
- io.prestosql.sql.planner.iterative.rule.PruneUnnestColumns
-
- All Implemented Interfaces:
Rule<ProjectNode>
public class PruneUnnestColumns extends ProjectOffPushDownRule<UnnestNode>
Absorb pruning projection into the node. Remove any unnecessary replicate symbols and ordinality symbol. Symbol is considered unnecessary if it is: - not referenced by the parent node - not used in filter expression Note: mappings are not eligible for pruning.Transforms:
- Project (c) - Unnest: replicate (a, b, c, d) mappings (d -> d1) ordinality (ord) filter (a > 5) - Source (a, b, c d)
into:- Project (c) - Unnest: replicate (a, c) mappings (d -> d1) ordinality () filter (a > 5) - Source (a, b, c, d)
Note: If, as a result of this rule, any of source's symbols became unreferenced, it will be addressed by PruneUnnestSourceColumns rule.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.prestosql.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Constructor Summary
Constructors Constructor Description PruneUnnestColumns()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Optional<PlanNode>
pushDownProjectOff(Rule.Context context, UnnestNode unnestNode, 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, UnnestNode unnestNode, Set<Symbol> referencedOutputs)
- Specified by:
pushDownProjectOff
in classProjectOffPushDownRule<UnnestNode>
-
-