Gengliang Wang created SPARK-28018:
--------------------------------------

             Summary: Allow upcasting decimal to double/float
                 Key: SPARK-28018
                 URL: https://issues.apache.org/jira/browse/SPARK-28018
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Gengliang Wang


Currently, Spark only allows upcasting DecimalType to IntegralType or 
DecimalType.
This PR proposes: if the target DecimalType is tighter than DoubleType or 
FloatType, we can upcast it as well.
The upcasting matters because it blocks 
https://github.com/apache/spark/pull/24806. E.g, if there is a table "t" with 
only one column of double type, 
```
INSERT INTO TABLE t SELECT 10.0
```
The data type of value 10.0 is DecimalType(3, 1). In the current code, the 
upcasting failed.




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to