Class TransformCorrelatedSingleRowSubqueryToProject
java.lang.Object
io.trino.sql.planner.iterative.rule.TransformCorrelatedSingleRowSubqueryToProject
- All Implemented Interfaces:
Rule<CorrelatedJoinNode>
public class TransformCorrelatedSingleRowSubqueryToProject
extends Object
implements Rule<CorrelatedJoinNode>
This optimizer can rewrite correlated single row subquery to projection in a way described here:
From:
- CorrelatedJoin (with correlation list: [A, C])
- (input) plan which produces symbols: [A, B, C]
- (subquery)
- Project (A + C)
- single row VALUES()
to:
- Project(A, B, C, A + C)
- (input) plan which produces symbols: [A, B, C]
It also transforms subquery with single-row values:
- CorrelatedJoin (with correlation list: [A, C])
- (input) plan which produces symbols: [A, B, C]
- (subquery)
- single row VALUES(1, A, C * 2)
to:
- Project(A, B, C, 1, C * 2) - (input) plan which produces symbols: [A, B, C]
-
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(CorrelatedJoinNode parent, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.
-
Constructor Details
-
TransformCorrelatedSingleRowSubqueryToProject
public TransformCorrelatedSingleRowSubqueryToProject()
-
-
Method Details
-
getPattern
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<CorrelatedJoinNode>
-