-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Presto-Main] Add long overflow checks for IntervalDayTime #24353
base: master
Are you sure you want to change the base?
Conversation
Thanks for the release note! Nit formatting and rephrasing suggestions to follow Release Note Guidelines.
|
presto-main/src/test/java/com/facebook/presto/type/TestIntervalDayTime.java
Outdated
Show resolved
Hide resolved
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.
Can you add some tests for all changed operators? I see only multiplication and division.
I don't think I can. My understanding is that the overflow happens when the operation on the interval value converted to ms exceeds the min/max value for longs. But since the value of the interval looks to be constrained to ints, the min / max value we can assign to this type is |
Description
Part of #24087.
Motivation and Context
Throwing an error instead of returning overflowed long values
Impact
Where previously some expressions could have resulted in an overflow and incorrect results, now they will fail with a NUMERIC_VALUE_OUT_OF_RANGE error.
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.