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