Skip to content
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

Fix overflow checking on optimized decimal sum #4072

Merged
merged 1 commit into from
Nov 10, 2021

Conversation

revans2
Copy link
Collaborator

@revans2 revans2 commented Nov 10, 2021

I found this yesterday while trying to check a few things with overflow on the decimal 128 branch. It turns out the underflow, and wrapped overflow were not being checked properly. I have fixed it, but the test would take a very long time to run and I am not sure we want to put into into our regular integration tests

spark.range(174467442481L).selectExpr("SUM(CAST(99999999 as Decimal(8, 0)))")

The changes for GpuUnscaledValue are there mostly to get the test to work. It turns out that UnscaledValue is applied after constant folding so if you have a Decimal constant value with precision 8 or lower that you are doing a SUM on it will not run on the GPU. It is a bit of a corner case. The changes for GpuUnscaledValue were already applied to the decimal128 support branch.

Signed-off-by: Robert (Bobby) Evans <bobby@apache.org>
@revans2 revans2 added the bug Something isn't working label Nov 10, 2021
@revans2 revans2 added this to the Nov 1 - Nov 12 milestone Nov 10, 2021
@revans2 revans2 self-assigned this Nov 10, 2021
@revans2
Copy link
Collaborator Author

revans2 commented Nov 10, 2021

build

@revans2 revans2 merged commit bd961dd into NVIDIA:branch-21.12 Nov 10, 2021
@revans2 revans2 deleted the make_decimal_fix branch November 10, 2021 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants