Class PruneApplyColumns
java.lang.Object
io.trino.sql.planner.iterative.rule.ProjectOffPushDownRule<ApplyNode>
io.trino.sql.planner.iterative.rule.PruneApplyColumns
- All Implemented Interfaces:
Rule<ProjectNode>
This rule restricts the outputs of ApplyNode's input and subquery
based on which ApplyNode's output symbols are referenced.
A symbol from input source can be pruned, when - it is not a referenced output symbol - it is not a correlation symbol - it is not referenced in subqueryAssignments
A symbol from subquery source can be pruned, when it is not referenced in subqueryAssignments.
A subquery assignment can be removed, when its key is not a referenced output symbol.
Note: this rule does not remove any symbols from the correlation list. This is responsibility of PruneApplyCorrelation rule.
Transforms:
- Project (i1, r1)
- Apply
correlation: [corr]
assignments:
r1 -> a in s1,
r2 -> b in s2,
- Input (a, b, corr)
- Subquery (s1, s2)
Into:
- Project (i1, r1)
- Apply
correlation: [corr]
assignments:
r1 -> a in s1,
- Project (a, corr)
- Input (a, b, corr)
- Project (s1)
- Subquery (s1, s2)
-
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, ApplyNode applyNode, Set<Symbol> referencedOutputs) Methods inherited from class io.trino.sql.planner.iterative.rule.ProjectOffPushDownRule
apply, getPattern
-
Constructor Details
-
PruneApplyColumns
public PruneApplyColumns()
-
-
Method Details
-
pushDownProjectOff
protected Optional<PlanNode> pushDownProjectOff(Rule.Context context, ApplyNode applyNode, Set<Symbol> referencedOutputs) - Specified by:
pushDownProjectOffin classProjectOffPushDownRule<ApplyNode>
-