Class RemoveEmptyExceptBranches
java.lang.Object
io.trino.sql.planner.iterative.rule.RemoveEmptyExceptBranches
- All Implemented Interfaces:
Rule<ExceptNode>
Removes branches from an ExceptNode that are guaranteed to produce 0 rows.
a projection to preserve the outputs symbols, in the case of EXCEPT ALL.
an aggregation to remove duplicates, in case of EXCEPT DISTINCT
A EXCEPT E1 EXCEPT E2 ... EXCEPT En is equivalent to A - (E1 + ... + En).
If any of the Ei sets is empty, it can be removed. If only A is left and it's empty, it gets replaced with
an empty Values node. Otherwise:
-
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(ExceptNode node, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.
-
Constructor Details
-
RemoveEmptyExceptBranches
public RemoveEmptyExceptBranches()
-
-
Method Details
-
getPattern
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<ExceptNode>
-
apply
- Specified by:
applyin interfaceRule<ExceptNode>
-