Class RemoveEmptyExceptBranches
- java.lang.Object
-
- io.trino.sql.planner.iterative.rule.RemoveEmptyExceptBranches
-
- All Implemented Interfaces:
Rule<ExceptNode>
public class RemoveEmptyExceptBranches extends Object implements Rule<ExceptNode>
Removes branches from an ExceptNode that are guaranteed to produce 0 rows.A EXCEPT E1 EXCEPT E2 ... EXCEPT Enis equivalent toA - (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:- a projection to preserve the outputs symbols, in the case of EXCEPT ALL.
- an aggregation to remove duplicates, in case of EXCEPT DISTINCT
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Constructor Summary
Constructors Constructor Description RemoveEmptyExceptBranches()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule.Resultapply(ExceptNode node, Captures captures, Rule.Context context)Pattern<ExceptNode>getPattern()Returns a pattern to which plan nodes this rule applies.
-
-
-
Method Detail
-
getPattern
public Pattern<ExceptNode> getPattern()
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<ExceptNode>
-
apply
public Rule.Result apply(ExceptNode node, Captures captures, Rule.Context context)
- Specified by:
applyin interfaceRule<ExceptNode>
-
-