Class RemoveRedundantDistinctLimit
java.lang.Object
io.trino.sql.planner.iterative.rule.RemoveRedundantDistinctLimit
- All Implemented Interfaces:
Rule<DistinctLimitNode>
Replace DistinctLimit node
1. With a empty ValuesNode when count is 0
2. With a Distinct node when the subplan is guaranteed to produce fewer rows than count
3. With its source when the subplan produces only one row
-
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(DistinctLimitNode node, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.
-
Constructor Details
-
RemoveRedundantDistinctLimit
public RemoveRedundantDistinctLimit()
-
-
Method Details
-
getPattern
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<DistinctLimitNode>
-
apply
- Specified by:
applyin interfaceRule<DistinctLimitNode>
-