Class MultipleDistinctAggregationToMarkDistinct
java.lang.Object
io.trino.sql.planner.iterative.rule.MultipleDistinctAggregationToMarkDistinct
- All Implemented Interfaces:
Rule<AggregationNode>
public class MultipleDistinctAggregationToMarkDistinct
extends Object
implements Rule<AggregationNode>
Implements distinct aggregations with different inputs by transforming plans of the following shape:
- Aggregation
GROUP BY (k)
F1(DISTINCT a0, a1, ...)
F2(DISTINCT b0, b1, ...)
F3(c0, c1, ...)
- X
into
- Aggregation
GROUP BY (k)
F1(a0, a1, ...) mask ($0)
F2(b0, b1, ...) mask ($1)
F3(c0, c1, ...)
- MarkDistinct (k, a0, a1, ...) -> $0
- MarkDistinct (k, b0, b1, ...) -> $1
- X
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result -
Constructor Summary
ConstructorsConstructorDescriptionMultipleDistinctAggregationToMarkDistinct(TaskCountEstimator taskCountEstimator) -
Method Summary
Modifier and TypeMethodDescriptionapply(AggregationNode parent, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.
-
Constructor Details
-
MultipleDistinctAggregationToMarkDistinct
-
-
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>
-