Class ValidateAggregationsWithDefaultValues

  • All Implemented Interfaces:
    PlanSanityChecker.Checker

    public class ValidateAggregationsWithDefaultValues
    extends Object
    implements PlanSanityChecker.Checker
    When an aggregation has an empty grouping set then a default value needs to be returned in the output (e.g: 0 for COUNT(*)). In case if the aggregation is split into FINAL and PARTIAL, then default values are produced by PARTIAL aggregations. In order for the default values not to be duplicated, FINAL aggregation needs to be separated from PARTIAL aggregation by a remote repartition exchange or the FINAL aggregation needs to be executed on a single node. In case both FINAL and PARTIAL aggregations are executed on a single node, then those need to separated by a local repartition exchange or the FINAL aggregation needs to be executed in a single thread.