DonnyZone edited a comment on pull request #1867:
URL: https://github.com/apache/calcite/pull/1867#issuecomment-625128635


   I investigated the return type for sum function in Hive[1] and Spark[2]. It 
seems they both compute the precision as `Math.min(MAX_PRECISION, 
inputPrecision + 10)`. Maybe we can align with them. 
   @wenhuitang @XuQianJin-Stars @hsyuan WDYT?
   
   
[1]https://github.com/apache/hive/blob/54b87999fa0c23f9902faae609e7441e0693a22b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFSum.java#L247
   
   
[2]https://github.com/apache/spark/blob/272d229005b7166ab83bbb8f44a4d5e9d89424a1/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Sum.scala#L56
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to