Class PruneUnnestColumns
java.lang.Object
io.trino.sql.planner.iterative.rule.ProjectOffPushDownRule<UnnestNode>
io.trino.sql.planner.iterative.rule.PruneUnnestColumns
- All Implemented Interfaces:
Rule<ProjectNode>
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.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionpushDownProjectOff(Rule.Context context, UnnestNode unnestNode, Set<Symbol> referencedOutputs) Methods inherited from class io.trino.sql.planner.iterative.rule.ProjectOffPushDownRule
apply, getPattern
-
Constructor Details
-
PruneUnnestColumns
public PruneUnnestColumns()
-
-
Method Details
-
pushDownProjectOff
protected Optional<PlanNode> pushDownProjectOff(Rule.Context context, UnnestNode unnestNode, Set<Symbol> referencedOutputs) - Specified by:
pushDownProjectOffin classProjectOffPushDownRule<UnnestNode>
-