Class RemoveRedundantDistinctAggregation
java.lang.Object
io.trino.sql.planner.iterative.rule.RemoveRedundantDistinctAggregation
- All Implemented Interfaces:
Rule<AggregationNode>
Removes DISTINCT only aggregation, when the input source is already distinct over a subset of
the grouping keys as a result of another aggregation.
Given:
- Aggregate[keys = [a, max]]
- Aggregate[keys = [a]]
max := max(b)
Produces:
- Aggregate[keys = [a]]
max := max(b)
-
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(AggregationNode aggregationNode, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.
-
Constructor Details
-
RemoveRedundantDistinctAggregation
public RemoveRedundantDistinctAggregation()
-
-
Method Details
-
getPattern
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<AggregationNode>
-
apply
- Specified by:
applyin interfaceRule<AggregationNode>
-