You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/06/12 08:09:59 UTC

[GitHub] [spark] gengliangwang opened a new pull request #24849: [SPARK-28018][SQL] Allow upcasting decimal to double/float

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:
users@infra.apache.org


With regards,
Apache Git Services

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