-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-35955][SQL] Check for overflow in Average in ANSI mode #33177
Conversation
Signed-off-by: Karen Feng <karen.feng@databricks.com>
I don't think this is related to SPARK-35855. |
Good catch @peter-toth - sorry, meant SPARK-35955 🤦♀️ |
Kubernetes integration test starting |
Kubernetes integration test status success |
Test build #140536 has finished for PR 33177 at commit
|
Thanks, merging to master |
late LGTM |
### What changes were proposed in this pull request? This bug was introduced by #33177 When checking overflow of the sum value in the average function, we should use the `sumDataType` instead of the input decimal type. ### Why are the changes needed? fix a regression ### Does this PR introduce _any_ user-facing change? Yes, the result was wrong before this PR. ### How was this patch tested? a new test Closes #34180 from cloud-fan/bug. Lead-authored-by: Wenchen Fan <wenchen@databricks.com> Co-authored-by: Wenchen Fan <cloud0fan@gmail.com> Signed-off-by: Gengliang Wang <gengliang@apache.org>
This bug was introduced by apache#33177 When checking overflow of the sum value in the average function, we should use the `sumDataType` instead of the input decimal type. fix a regression Yes, the result was wrong before this PR. a new test Closes apache#34180 from cloud-fan/bug. Lead-authored-by: Wenchen Fan <wenchen@databricks.com> Co-authored-by: Wenchen Fan <cloud0fan@gmail.com> Signed-off-by: Gengliang Wang <gengliang@apache.org>
backport #34180 ### What changes were proposed in this pull request? This bug was introduced by #33177 When checking overflow of the sum value in the average function, we should use the `sumDataType` instead of the input decimal type. ### Why are the changes needed? fix a regression ### Does this PR introduce _any_ user-facing change? Yes, the result was wrong before this PR. ### How was this patch tested? a new test Closes #34193 from cloud-fan/bug. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Gengliang Wang <gengliang@apache.org>
backport apache#34180 ### What changes were proposed in this pull request? This bug was introduced by apache#33177 When checking overflow of the sum value in the average function, we should use the `sumDataType` instead of the input decimal type. ### Why are the changes needed? fix a regression ### Does this PR introduce _any_ user-facing change? Yes, the result was wrong before this PR. ### How was this patch tested? a new test Closes apache#34193 from cloud-fan/bug. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Gengliang Wang <gengliang@apache.org>
What changes were proposed in this pull request?
Fixes decimal overflow issues for decimal average in ANSI mode, so that overflows throw an exception rather than returning null.
Why are the changes needed?
Query:
Before:
After:
Does this PR introduce any user-facing change?
No
How was this patch tested?
Unit test