GitHub user heary-cao opened a pull request:
https://github.com/apache/spark/pull/18069
Improve division and multiplication mixing process the data
## What changes were proposed in this pull request?
spark-sql> select (1234567890123456789012 / 12345678901234567890120) *
12345678901234567890120;
NULL
spark-sql> select (12345678901234567890 / 123) * 123;
NULL
when the length of the getText is greater than 19, The result is not what
we expected.
but mysql handle the value is ok.
mysql> select (1234567890123456789012 / 12345678901234567890120) *
12345678901234567890120;
+------------------------------------------------------------------------------+
| (1234567890123456789012 / 12345678901234567890120) *
12345678901234567890120 |
+------------------------------------------------------------------------------+
|
1234567890123456789012.0000 |
+------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
mysql> select (12345678901234567890 / 123) * 123;
+------------------------------------+
| (12345678901234567890 / 123) * 123 |
+------------------------------------+
| 12345678901234567890.0000 |
+------------------------------------+
1 row in set (0.00 sec)
## How was this patch tested?
Supplement the unit test.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/heary-cao/spark slash_handle
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/18069.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #18069
----
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]