-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-35177][SQL] Fix arithmetic overflow in parsing the minimal interval by IntervalUtils.fromYearMonthString
#32281
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
…t.MinValue months correctly
|
FYI @MaxGekk |
|
Kubernetes integration test unable to build dist. exiting with code: 1 |
|
Test build #137756 has finished for PR 32281 at commit
|
|
@AngersZhuuuu JIRA ID seems to be wrong. Could you confirm it? |
Done. |
|
retest this please |
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
MaxGekk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make PR's title more precise, for example:
[SPARK-35177][SQL] Fix arithmetic overflow in parsing the minimal interval by IntervalUtils.fromYearMonthString
IntervalUtils.fromYearMonthString
Done |
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/IntervalUtilsSuite.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/IntervalUtilsSuite.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
Outdated
Show resolved
Hide resolved
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
+1, LGTM. GA passed. Merging to master. |
|
Test build #137765 has finished for PR 32281 at commit
|
|
Test build #137786 has finished for PR 32281 at commit
|
|
Test build #137779 has finished for PR 32281 at commit
|

What changes were proposed in this pull request?
IntervalUtils.fromYearMonthString should handle Int.MinValue months correctly.
In current logic, just use
Math.addExact(Math.multiplyExact(years, 12), months)to calculate negative total months will overflow when actual total months is Int.MinValue, this pr fixes this bug.Why are the changes needed?
IntervalUtils.fromYearMonthString should handle Int.MinValue months correctly
Does this PR introduce any user-facing change?
No
How was this patch tested?
Added UT