Class TransformExistsApplyToCorrelatedJoin
- java.lang.Object
-
- io.prestosql.sql.planner.iterative.rule.TransformExistsApplyToCorrelatedJoin
-
public class TransformExistsApplyToCorrelatedJoin extends Object implements Rule<ApplyNode>
EXISTS is modeled as (if correlated predicates are equality comparisons):- Project(exists := COALESCE(subqueryTrue, false)) - CorrelatedJoin(LEFT) - input - Project(subqueryTrue := true) - Limit(count=1) - subquery
or:- CorrelatedJoin(LEFT) - input - Project($0 > 0) - Aggregation(COUNT(*)) - subquery
otherwise
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.prestosql.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Constructor Summary
Constructors Constructor Description TransformExistsApplyToCorrelatedJoin(Metadata metadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule.Result
apply(ApplyNode parent, Captures captures, Rule.Context context)
Pattern<ApplyNode>
getPattern()
Returns a pattern to which plan nodes this rule applies.
-
-
-
Constructor Detail
-
TransformExistsApplyToCorrelatedJoin
public TransformExistsApplyToCorrelatedJoin(Metadata metadata)
-
-
Method Detail
-
getPattern
public Pattern<ApplyNode> getPattern()
Description copied from interface:Rule
Returns a pattern to which plan nodes this rule applies.- Specified by:
getPattern
in interfaceRule<ApplyNode>
-
apply
public Rule.Result apply(ApplyNode parent, Captures captures, Rule.Context context)
-
-