Status: Patch Available
Affects Version/s: None
Fix Version/s: None
Component/s: Query Processor
In most cases, partial distinct aggregation is not needed in map-side groupby. The exception is that with sorted bucketized tables partial distinct aggregation can be done by the mappers in some scenarios, as what is done by GroupByOptimzer.
Currently, partial distinct aggregation is done in the map-side GroupBy and then shuffle of the partial result is done in the following ReduceSink operator, in cases where they are not needed. This wastes CPU cycles, memory and network bandwidth.
This optimization eliminates un-needed partial distinct aggregations, which improves performance and reduces memory usage.
EXPLAIN SELECT key, count(DISTINCT value) FROM src GROUP BY key;