Class TransformCorrelatedInPredicateToJoin
java.lang.Object
io.trino.sql.planner.iterative.rule.TransformCorrelatedInPredicateToJoin
Replaces correlated ApplyNode with InPredicate expression with SemiJoin
Transforms:
- Apply (output: a in B.b)
- input: some plan A producing symbol a
- subquery: some plan B producing symbol b, using symbols from A
Into:
- Project (output: CASE WHEN (countmatches > 0) THEN true WHEN (countnullmatches > 0) THEN null ELSE false END)
- Aggregate (countmatches=count(*) where a, b not null; countnullmatches where (a is null or b is null) but buildSideKnownNonNull is not null)
grouping by (A'.*)
- LeftJoin on (a = B.b, A and B correlation condition)
- AssignUniqueId (A')
- A
- See Also:
-
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 apply, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.