Class ImplementFilteredAggregations
java.lang.Object
io.trino.sql.planner.iterative.rule.ImplementFilteredAggregations
- All Implemented Interfaces:
Rule<AggregationNode>
Implements filtered aggregations by transforming plans of the following shape:
- Aggregation
F1(...) FILTER (WHERE C1(...)),
F2(...) FILTER (WHERE C2(...)), mask (m)
- X
into
- Aggregation
F1(...) mask ($0)
F2(...) mask ($2)
- Filter(mask ($0) OR mask ($2))
- Project
<identity projections for existing fields>
$2 = m AND $1
- Project
<identity projections for existing fields>
$0 = C1(...)
$1 = C2(...)
- X
-
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
-
ImplementFilteredAggregations
public ImplementFilteredAggregations()
-
-
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>
-