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]