Tonix517 opened a new pull request #24940: [SPARK-28135] Better double support 
in SQL ceil/floor functions
URL: https://github.com/apache/spark/pull/24940
 
 
   ## What changes were proposed in this pull request?
   
   The existing Ceil and Floor case classes in SQL mathExpressions.scala 
doesn't support double well.
   When using large doubles in the query, LongType max will be returned instead 
of the correct large double values (e.g. select 
ceil(double(1.2345678901234e+200)), ceiling(double(1.2345678901234e+200)), 
floor(double(1.2345678901234e+200)); used in the ticket).
   
   In this patch, better double support is added. Now the data overflow bug has 
been fixed by this patch, also now Ceil and Floor has correct semantics in 
certain use cases, e.g. double should be returned when input param is double. 
In the existing code, long will be the default return type regardless of the 
input data types.
   
   ## How was this patch tested?
   
   All spark unit tests:
   ./build/sbt test
   
   All SQL tests:
   ./build/sbt "testOnly org.apache.spark.sql.*"
   
   @wangyum @mgaido91 @HyukjinKwon 

----------------------------------------------------------------
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]

Reply via email to