Class MeasureRules.AggregateMeasureRule

All Implemented Interfaces:
TransformationRule
Enclosing class:
MeasureRules

public static class MeasureRules.AggregateMeasureRule extends RelRule<MeasureRules.AggregateMeasureRuleConfig> implements TransformationRule
Rule that matches an Aggregate with at least one call to SqlInternalOperators.AGG_M2V and converts those calls to SqlInternalOperators.M2X.

Converts


 Aggregate(a, b, AGG_M2V(c), SUM(d), AGG_M2V(e))
   R
 

to


 Aggregate(a, b, SINGLE_VALUE(c), SUM(d), SINGLE_VALUE(e))
   Project(a, b, c, d, e, M2X(c, SAME_PARTITION(a, b)),
        M2X(e, SAME_PARTITION(a, b)))
     R
 

We rely on those M2X calls being pushed down until they merge with V2M2 and MeasureRules.ProjectMeasureRule can apply.

See Also: