Class PruneApplySourceColumns
- java.lang.Object
-
- io.prestosql.sql.planner.iterative.rule.PruneApplySourceColumns
-
public class PruneApplySourceColumns extends Object implements Rule<ApplyNode>
This rule restricts outputs of ApplyNode's subquery to include only the symbols needed for subqueryAssignments. Symbols from the subquery are not produced at ApplyNode's output. They are only used for the assignments. Transforms:- Apply correlation: [corr_symbol] assignments: result_1 -> a in subquery_symbol_1, result_2 -> b > ALL subquery_symbol_2 - Input (a, b, corr_symbol) - Subquery (subquery_symbol_1, subquery_symbol_2, subquery_symbol_3)
Into:- Apply correlation: [corr_symbol] assignments: result_1 -> a in subquery_symbol_1, result_2 -> b > ALL subquery_symbol_2 - Input (a, b, corr_symbol) - Project subquery_symbol_1 -> subquery_symbol_1 subquery_symbol_2 -> subquery_symbol_2 - Subquery (subquery_symbol_1, subquery_symbol_2, subquery_symbol_3)
Note: ApplyNode's input symbols are produced on ApplyNode's output. They cannot be pruned without outer context.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.prestosql.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Constructor Summary
Constructors Constructor Description PruneApplySourceColumns()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule.Result
apply(ApplyNode applyNode, Captures captures, Rule.Context context)
Pattern<ApplyNode>
getPattern()
Returns a pattern to which plan nodes this rule applies.
-
-
-
Method Detail
-
getPattern
public Pattern<ApplyNode> getPattern()
Description copied from interface:Rule
Returns a pattern to which plan nodes this rule applies.- Specified by:
getPattern
in interfaceRule<ApplyNode>
-
apply
public Rule.Result apply(ApplyNode applyNode, Captures captures, Rule.Context context)
-
-