You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/07/02 19:54:24 UTC

[GitHub] [spark] mgaido91 opened a new pull request #25035: [SPARK-28235][SQL] Sum of decimals should return a decimal with MAX_PRECISION

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org