You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "liuxian (JIRA)" <ji...@apache.org> on 2017/05/22 08:45:04 UTC

[jira] [Created] (SPARK-20834) TypeCoercion:In case 1,loss of precision is not acceptable

liuxian created SPARK-20834:
-------------------------------

             Summary: TypeCoercion:In case 1,loss of precision is not acceptable
                 Key: SPARK-20834
                 URL: https://issues.apache.org/jira/browse/SPARK-20834
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.1.0, 2.2.0
            Reporter: liuxian


spark-sql>select if(true, 123456789, cast(1.23 as float));
spark-sql>1.23456792E8
select if(true, 123456789012345678, cast(1.23 as double));
spark-sql>1.2345678901234568E17
For these two cases, the result is not we expected, it lost precision.
The rules for  `IntegerType` -> 'FloatType',   `LongType` -> 'FloatType',   `LongType` ->'DoubleType' , i think these can improve



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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