Class ImplementFilteredAggregations
- java.lang.Object
-
- io.prestosql.sql.planner.iterative.rule.ImplementFilteredAggregations
-
- All Implemented Interfaces:
Rule<AggregationNode>
public class ImplementFilteredAggregations extends Object implements Rule<AggregationNode>
Implements filtered aggregations by transforming plans of the following shape:- Aggregation F1(...) FILTER (WHERE C1(...)), F2(...) FILTER (WHERE C2(...)) - X
into- Aggregation F1(...) mask ($0) F2(...) mask ($1) - Filter(mask ($0) OR mask ($1)) - Project <identity projections for existing fields> $0 = C1(...) $1 = C2(...) - X
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.prestosql.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Constructor Summary
Constructors Constructor Description ImplementFilteredAggregations(Metadata metadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule.Result
apply(AggregationNode aggregationNode, Captures captures, Rule.Context context)
Pattern<AggregationNode>
getPattern()
Returns a pattern to which plan nodes this rule applies.
-
-
-
Constructor Detail
-
ImplementFilteredAggregations
public ImplementFilteredAggregations(Metadata metadata)
-
-
Method Detail
-
getPattern
public Pattern<AggregationNode> getPattern()
Description copied from interface:Rule
Returns a pattern to which plan nodes this rule applies.- Specified by:
getPattern
in interfaceRule<AggregationNode>
-
apply
public Rule.Result apply(AggregationNode aggregationNode, Captures captures, Rule.Context context)
- Specified by:
apply
in interfaceRule<AggregationNode>
-
-