-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-18745][SQL] Fix signed integer overflow due to toInt cast #16235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
LGTM - pending jenkins. @kiszk do you think there is a sane way of testing this? |
|
also cc @davies |
|
Test build #69926 has finished for PR 16235 at commit
|
|
retest this please |
|
LGTM, thanks for fixing it! |
|
@hvanhovell if we want to test these methods, it seems to be complicated since we have to allocate large |
|
Ok, lets not do that for now. |
|
It might at some point be an idea to add a bunch of asserts to |
|
Test build #69928 has finished for PR 16235 at commit
|
|
Jenkins, retest this please |
|
Test build #69930 has finished for PR 16235 at commit
|
|
Merging to master/2.1/2.0. Thanks! |
## What changes were proposed in this pull request? This PR avoids that a result of a cast `toInt` is negative due to signed integer overflow (e.g. 0x0000_0000_1???????L.toInt < 0 ). This PR performs casts after we can ensure the value is within range of signed integer (the result of `max(array.length, ???)` is always integer). ## How was this patch tested? Manually executed query68 of TPC-DS with 100TB Author: Kazuaki Ishizaki <[email protected]> Closes #16235 from kiszk/SPARK-18745. (cherry picked from commit d60ab5f) Signed-off-by: Herman van Hovell <[email protected]>
## What changes were proposed in this pull request? This PR avoids that a result of a cast `toInt` is negative due to signed integer overflow (e.g. 0x0000_0000_1???????L.toInt < 0 ). This PR performs casts after we can ensure the value is within range of signed integer (the result of `max(array.length, ???)` is always integer). ## How was this patch tested? Manually executed query68 of TPC-DS with 100TB Author: Kazuaki Ishizaki <[email protected]> Closes #16235 from kiszk/SPARK-18745. (cherry picked from commit d60ab5f) Signed-off-by: Herman van Hovell <[email protected]>
## What changes were proposed in this pull request? This PR avoids that a result of a cast `toInt` is negative due to signed integer overflow (e.g. 0x0000_0000_1???????L.toInt < 0 ). This PR performs casts after we can ensure the value is within range of signed integer (the result of `max(array.length, ???)` is always integer). ## How was this patch tested? Manually executed query68 of TPC-DS with 100TB Author: Kazuaki Ishizaki <[email protected]> Closes apache#16235 from kiszk/SPARK-18745.
## What changes were proposed in this pull request? This PR avoids that a result of a cast `toInt` is negative due to signed integer overflow (e.g. 0x0000_0000_1???????L.toInt < 0 ). This PR performs casts after we can ensure the value is within range of signed integer (the result of `max(array.length, ???)` is always integer). ## How was this patch tested? Manually executed query68 of TPC-DS with 100TB Author: Kazuaki Ishizaki <[email protected]> Closes apache#16235 from kiszk/SPARK-18745.
What changes were proposed in this pull request?
This PR avoids that a result of a cast
toIntis negative due to signed integer overflow (e.g. 0x0000_0000_1???????L.toInt < 0 ). This PR performs casts after we can ensure the value is within range of signed integer (the result ofmax(array.length, ???)is always integer).How was this patch tested?
Manually executed query68 of TPC-DS with 100TB