mickjermsurawong-stripe commented on issue #25033: [SPARK-28224][SQL] Aggregate 
sum large decimals
URL: https://github.com/apache/spark/pull/25033#issuecomment-508624866
 
 
   @mgaido91, thank you for the review! I made the updates.
   To your original question on SQL server behavior, there seem to be different 
outcome among sql versions. From fiddle here:
   Sql5.6 would arbitrarily loose precision even on integral parts with 
rounding. [0]
   Sql MS Sql Server107 would show error Data truncation [1]
   
   Aiming for a least-surprise behavior, do you think `sum` here should be 
treated the same as other arithmetic operations on fixed precisions? 
   
   A larger question here is perhaps if there are other operations on fixed 
precision that could result in overflow. And supposed we are okay with this PR 
fix, does it mean we should patch for all such operators? A non-issue here is 
`pow` operator with Double type.
   
   [0] http://sqlfiddle.com/#!9/676c31/1
   [1] http://sqlfiddle.com/#!18/0baa5/1 
   

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to