You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/05/20 04:34:00 UTC

[jira] [Commented] (SPARK-39238) Decimal precision loss from applying WidenSetOperationTypes before DecimalPrecision

    [ https://issues.apache.org/jira/browse/SPARK-39238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17539919#comment-17539919 ] 

Apache Spark commented on SPARK-39238:
--------------------------------------

User 'manuzhang' has created a pull request for this issue:
https://github.com/apache/spark/pull/36615

> Decimal precision loss from applying WidenSetOperationTypes before DecimalPrecision 
> ------------------------------------------------------------------------------------
>
>                 Key: SPARK-39238
>                 URL: https://issues.apache.org/jira/browse/SPARK-39238
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.3.1
>            Reporter: Manu Zhang
>            Priority: Major
>
> The result of following SQL is 1.00 while 1.00000000000000000000 is expected
> {code:java}
> CREATE OR REPLACE TEMPORARY VIEW t3 AS VALUES (decimal(1)) tbl(v)
> CREATE OR REPLACE TEMPORARY VIEW t4 AS SELECT CAST(v AS DECIMAL(18, 2)) AS v FROM t3;
> SELECT CAST(1 AS DECIMAL(28, 2))
> UNION ALL
> SELECT v / v FROM t4; {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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