You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (Jira)" <ji...@apache.org> on 2020/03/16 22:55:05 UTC

[jira] [Updated] (SPARK-28235) Decimal sum return type

     [ https://issues.apache.org/jira/browse/SPARK-28235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dongjoon Hyun updated SPARK-28235:
----------------------------------
    Affects Version/s:     (was: 3.0.0)
                       3.1.0

> Decimal sum return type
> -----------------------
>
>                 Key: SPARK-28235
>                 URL: https://issues.apache.org/jira/browse/SPARK-28235
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.1.0
>            Reporter: Marco Gaido
>            Priority: Major
>
> Our implementation of decimal operations follows SQLServer behavior. As per https://docs.microsoft.com/it-it/sql/t-sql/functions/sum-transact-sql?view=sql-server-2017, the result of sum operation should be `DECIMAL(38, s)` while currently we are setting it to `DECIMAL(10 + p, s)`. This means that with large datasets, we may incur in overflow, even though we may have been able to represent the value with higher precision and SQLServer returns correct results in that case.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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