Class SingleDistinctAggregationToGroupBy

  • All Implemented Interfaces:
    Rule<AggregationNode>

    public class SingleDistinctAggregationToGroupBy
    extends Object
    implements 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(x)
              F2(x)
          - Aggregation
                 GROUP BY (k, s0, s1, ...)
              - X
     

    Assumes s0, s1, ... are symbol references (i.e., complex expressions have been pre-projected)