Class RemoveRedundantDistinctLimit
- java.lang.Object
-
- io.prestosql.sql.planner.iterative.rule.RemoveRedundantDistinctLimit
-
- All Implemented Interfaces:
Rule<DistinctLimitNode>
public class RemoveRedundantDistinctLimit extends Object implements 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.prestosql.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Constructor Summary
Constructors Constructor Description RemoveRedundantDistinctLimit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule.Result
apply(DistinctLimitNode node, Captures captures, Rule.Context context)
Pattern<DistinctLimitNode>
getPattern()
Returns a pattern to which plan nodes this rule applies.
-
-
-
Method Detail
-
getPattern
public Pattern<DistinctLimitNode> getPattern()
Description copied from interface:Rule
Returns a pattern to which plan nodes this rule applies.- Specified by:
getPattern
in interfaceRule<DistinctLimitNode>
-
apply
public Rule.Result apply(DistinctLimitNode node, Captures captures, Rule.Context context)
- Specified by:
apply
in interfaceRule<DistinctLimitNode>
-
-