Class SingleDistinctAggregationToGroupBy
java.lang.Object
io.trino.sql.planner.iterative.rule.SingleDistinctAggregationToGroupBy
- All Implemented Interfaces:
Rule<AggregationNode>
Implements distinct aggregations with similar inputs by transforming plans of the following shape:
- Aggregation
GROUP BY (k)
F1(DISTINCT s0, s1, ...),
F2(DISTINCT s0, s1, ...),
- X
into
- Aggregation
GROUP BY (k)
F1(s0, s1, ...)
F2(s0, s1, ...)
- Aggregation
GROUP BY (k, s0, s1, ...)
- X
Assumes s0, s1, ... are symbol references (i.e., complex expressions have been pre-projected)
-
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 aggregation, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.
-
Constructor Details
-
SingleDistinctAggregationToGroupBy
public SingleDistinctAggregationToGroupBy()
-
-
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>
-