gengliangwang opened a new pull request #24849: [SPARK-28018][SQL] Allow upcasting decimal to double/float URL: https://github.com/apache/spark/pull/24849 ## What changes were proposed in this pull request? 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, Spark can't upcast the decimal to the column of double type. ## How was this patch tested? Unit test
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
