Class TransformUncorrelatedInPredicateSubqueryToSemiJoin

java.lang.Object
io.trino.sql.planner.iterative.rule.TransformUncorrelatedInPredicateSubqueryToSemiJoin
All Implemented Interfaces:
Rule<ApplyNode>

public class TransformUncorrelatedInPredicateSubqueryToSemiJoin extends Object implements Rule<ApplyNode>
This optimizers looks for InPredicate expressions in ApplyNodes and replaces the nodes with SemiJoin nodes.

Plan before optimizer:

 Filter(a IN b):
   Apply
     - correlation: []  // empty
     - input: some plan A producing symbol a
     - subquery: some plan B producing symbol b
 

Plan after optimizer:

 Filter(semijoinresult):
   SemiJoin
     - source: plan A
     - filteringSource: symbol a
     - sourceJoinSymbol: plan B
     - filteringSourceJoinSymbol: symbol b
     - semiJoinOutput: semijoinresult