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/23 23:19:12 UTC
[GitHub] [spark] Tonix517 opened a new pull request #24940: [SPARK-28135]
Better double support in SQL ceil/floor functions
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:
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