Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tighten check for splitting aggregation node
When a single-step aggregation has empty and non-empty grouping sets and runs in a partitioned stage (i.e., sits on a partitioning exchange), there needs to be a partial below the exchange that will produce default intermediate output for the empty grouping set. AddExchanges currently produces a "broken" plan without the partial, which is fixed by PushPartialAggregationThroughExchange. The current check is too broad though, as it forces the aggregation to be split even if it runs in a single node (i.e., sits on top of a gathering exchange). If the aggregation is not decomposable, it's not possible to do so, and the planning fails. This change tightens the check to force the split only for an aggregation on top of a partitioning exchange.
- Loading branch information