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: [email protected]
For additional commands, e-mail: [email protected]