Class PruneApplySourceColumns
java.lang.Object
io.trino.sql.planner.iterative.rule.PruneApplySourceColumns
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.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(ApplyNode applyNode, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.
-
Constructor Details
-
PruneApplySourceColumns
public PruneApplySourceColumns()
-
-
Method Details