Class TransformCorrelatedInPredicateToJoin
- java.lang.Object
-
- io.trino.sql.planner.iterative.rule.TransformCorrelatedInPredicateToJoin
-
public class TransformCorrelatedInPredicateToJoin extends Object implements Rule<ApplyNode>
Replaces correlated ApplyNode with InPredicate expression with SemiJoinTransforms:
- Apply (output: a in B.b) - input: some plan A producing symbol a - subquery: some plan B producing symbol b, using symbols from AInto:- 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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Constructor Summary
Constructors Constructor Description TransformCorrelatedInPredicateToJoin(Metadata metadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule.Resultapply(ApplyNode apply, Captures captures, Rule.Context context)Pattern<ApplyNode>getPattern()Returns a pattern to which plan nodes this rule applies.
-
-
-
Constructor Detail
-
TransformCorrelatedInPredicateToJoin
public TransformCorrelatedInPredicateToJoin(Metadata metadata)
-
-
Method Detail
-
getPattern
public Pattern<ApplyNode> getPattern()
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<ApplyNode>
-
apply
public Rule.Result apply(ApplyNode apply, Captures captures, Rule.Context context)
-
-