Uh oh!
There was an error while loading. Please reload this page.
[SPARK-20786][SQL][Backport-2.2]Improve ceil and floor handle the value which is not expected - #18057
[SPARK-20786][SQL][Backport-2.2]Improve ceil and floor handle the value which is not expected#18057heary-cao wants to merge 1 commit into
Conversation
hvanhovell
commented
May 22, 2017
ok to test |
SparkQA
commented
May 22, 2017
Test build #77178 has finished for PR 18057 at commit
|
5cdb501 to
1ecd0e2CompareSparkQA
commented
May 22, 2017
Test build #77184 has finished for PR 18057 at commit
|
1ecd0e2 to
eaf236aCompareThere was a problem hiding this comment.
The default type should be DoubleType
There was a problem hiding this comment.
The default type should be DoubleType
SparkQA
commented
May 25, 2017
Test build #77327 has finished for PR 18057 at commit
|
eaf236a to
4c68688CompareSparkQA
commented
May 25, 2017
Test build #77333 has finished for PR 18057 at commit
|
| override def inputTypes: Seq[AbstractDataType] = | ||
| Seq(TypeCollection(DoubleType, DecimalType)) | ||
| Seq(TypeCollection(DoubleType, LongType, DecimalType)) |
There was a problem hiding this comment.
I don't think we should modify the change from what we did at master when backporting as far as possible .
If you want to modify this, let's submit another pr to master first, and then backport it too.
heary-cao
commented
May 25, 2017
the patch by #18103 merge together. |
What changes were proposed in this pull request?
This PR is to backport #18016 to Spark branch-2.2
spark-sql>SELECT ceil(1234567890123456);
1234567890123456
spark-sql>SELECT ceil(12345678901234567);
12345678901234568
spark-sql>SELECT ceil(123456789012345678);
123456789012345680
when the length of the getText is greater than 16. long to double will be precision loss.
but mysql handle the value is ok.
mysql> SELECT ceil(1234567890123456);
+------------------------+
| ceil(1234567890123456) |
+------------------------+
| 1234567890123456 |
+------------------------+
1 row in set (0.00 sec)
mysql> SELECT ceil(12345678901234567);
+-------------------------+
| ceil(12345678901234567) |
+-------------------------+
| 12345678901234567 |
+-------------------------+
1 row in set (0.00 sec)
mysql> SELECT ceil(123456789012345678);
+--------------------------+
| ceil(123456789012345678) |
+--------------------------+
| 123456789012345678 |
+--------------------------+
1 row in set (0.00 sec)
How was this patch tested?
the unit test.