Class RemoveRedundantDistinctLimit

java.lang.Object
io.trino.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