mgaido91 opened a new pull request #25035: [SPARK-28235][SQL] Sum of decimals 
should return a decimal with MAX_PRECISION
URL: https://github.com/apache/spark/pull/25035
 
 
   ## What changes were proposed in this pull request?
   
   Spark's decimal operations implementation follows what SQLServer does. This 
is not true for the `Sum` operation. In that case, SQLServer returns 
`DECIMAL(38, s)` where `s` is the scale of the input of the sum operator. Spark 
instead, uses as precision of the result type `p + 10` where `p` is the 
precision of the input type. This can cause overflows, which can be avoided 
with a higher precision: it happens in particular with sums of many decimals 
with a small precision.
   
   ## How was this patch tested?
   
   changed UTs

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