You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "XiDuo You (Jira)" <ji...@apache.org> on 2022/07/17 13:07:00 UTC

[jira] [Updated] (SPARK-39792) Add DecimalDivideWithOverflowCheck for decimal average

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

XiDuo You updated SPARK-39792:
------------------------------
    Description: If the result data type is decimal, the Average will first calculate the result using the default precison and scale of divide, then cast to the result data type. We should do calculate and return the result data type directly so that we can avoid the precision loss. It can also save one unnecessary cast.  (was: If the result data type is decimal, the Average will first calculate the result using precison and scale of divide, then cast to the result data type. Ideally, we can save this cast by returning the result data type directly.)

> Add DecimalDivideWithOverflowCheck for decimal average
> ------------------------------------------------------
>
>                 Key: SPARK-39792
>                 URL: https://issues.apache.org/jira/browse/SPARK-39792
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.4.0
>            Reporter: XiDuo You
>            Priority: Major
>
> If the result data type is decimal, the Average will first calculate the result using the default precison and scale of divide, then cast to the result data type. We should do calculate and return the result data type directly so that we can avoid the precision loss. It can also save one unnecessary cast.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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