kasakrisz commented on code in PR #6963:
URL: https://github.com/apache/hive/pull/6963#discussion_r4706792470
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/CorrelationUtilities.java:
##########
@@ -433,7 +432,11 @@ protected static void
removeReduceSinkForGroupBy(ReduceSinkOperator cRS, GroupBy
.getConf().getKeys(), cGBYr, cRS), cRS, cGBYm));
cGBYr.getConf().setAggregators(cGBYm.getConf().getAggregators());
for (AggregationDesc aggr : cGBYm.getConf().getAggregators()) {
- aggr.setMode(GenericUDAFEvaluator.Mode.COMPLETE);
+ // a map-side aggregation over the partial results of an aggregation
pushed below a join
+ // (see PartialGroupByJoinTransposeOptimizer) merges them: it can only
finalize them
+ boolean mergesPartials = cGBYm.getConf().getMode() ==
GroupByDesc.Mode.HASH
+ && aggr.getMode() == GenericUDAFEvaluator.Mode.PARTIAL2;
+ aggr.setMode(mergesPartials ? GenericUDAFEvaluator.Mode.FINAL :
GenericUDAFEvaluator.Mode.COMPLETE);
Review Comment:
Added tests into partial_aggr_join_transpose.q.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]