Class ImplementIntersectAll
java.lang.Object
io.trino.sql.planner.iterative.rule.ImplementIntersectAll
- All Implemented Interfaces:
Rule<IntersectNode>
Implement INTERSECT ALL using union, window and filter.
Transforms:
- Intersect all
output: a, b
- Source1 (a1, b1)
- Source2 (a2, b2)
- Source3 (a3, b3)
Into:
- Project (prune helper symbols)
output: a, b
- Filter (row_number invalid input: '<'= least(least(count1, count2), count3))
- Window (partition by a, b)
count1 invalid input: '<'- count(marker1)
count2 invalid input: '<'- count(marker2)
count3 invalid input: '<'- count(marker3)
row_number invalid input: '<'- row_number()
- Union
output: a, b, marker1, marker2, marker3
- Project (marker1 invalid input: '<'- true, marker2 invalid input: '<'- null, marker3 invalid input: '<'- null)
- Source1 (a1, b1)
- Project (marker1 invalid input: '<'- null, marker2 invalid input: '<'- true, marker3 invalid input: '<'- null)
- Source2 (a2, b2)
- Project (marker1 invalid input: '<'- null, marker2 invalid input: '<'- null, marker3 invalid input: '<'- true)
- Source3 (a3, b3)
-
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(IntersectNode node, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.
-
Constructor Details
-
ImplementIntersectAll
-
-
Method Details
-
getPattern
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<IntersectNode>
-
apply
- Specified by:
applyin interfaceRule<IntersectNode>
-