scarlin-cloudera commented on code in PR #3800:
URL: https://github.com/apache/hive/pull/3800#discussion_r1038620856


##########
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFSum.java:
##########
@@ -337,29 +345,35 @@ public GenericUDAFEvaluator 
getWindowingEvaluator(WindowFrameDef wFrameDef) {
         return null;
       }
 
-      return new 
GenericUDAFStreamingEvaluator.SumAvgEnhancer<HiveDecimalWritable, HiveDecimal>(
+      return new 
GenericUDAFStreamingEvaluator.SumAvgEnhancer<HiveDecimalWritable, Object[]>(

Review Comment:
   This matches very similar logic found in GenericUDAFAvg which also uses an 
Object[] 
   
   The purpose is that we need to keep track of the sum while also keeping 
track whether the current window member is a null.  If all members in the 
window frame are null, we should treat the sum as null instead of 0, which is 
how the "preceding" rows behave.



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to