-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add overflow detection to IntervalYearMonthOperators #24089
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
10d59aa to
c58bf94
Compare
hantangwangd
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.
Thanks for the fix, looks good to me, only some nits.
presto-main/src/main/java/com/facebook/presto/type/IntervalYearMonthOperators.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/type/IntervalYearMonthOperators.java
Outdated
Show resolved
Hide resolved
presto-main/src/test/java/com/facebook/presto/type/TestIntervalYearMonth.java
Outdated
Show resolved
Hide resolved
c58bf94 to
5c50738
Compare
|
Thanks for the review @hantangwangd, I have updated the PR. |
hantangwangd
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.
LGTM! Thanks for the fix.
|
Closing this PR as the change is merged in #24617. |
Summary: Add support for mathematical functions `plus`, `minus`, `multiply`, and `divide` with `IntervalYearMonth` type. The function signatures added match that of [Presto](https://github.com/prestodb/presto/blob/master/presto-main/src/main/java/com/facebook/presto/type/IntervalYearMonthOperators.java), accounting for the Presto function signature changes in prestodb/presto#24089. Pull Request resolved: #11612 Reviewed By: pedroerp Differential Revision: D72997442 Pulled By: kKPulla fbshipit-source-id: 5fcf40639ed0af63e6ec198994aeaef49ba367cb
…incubator#11612) Summary: Add support for mathematical functions `plus`, `minus`, `multiply`, and `divide` with `IntervalYearMonth` type. The function signatures added match that of [Presto](https://github.com/prestodb/presto/blob/master/presto-main/src/main/java/com/facebook/presto/type/IntervalYearMonthOperators.java), accounting for the Presto function signature changes in prestodb/presto#24089. Pull Request resolved: facebookincubator#11612 Reviewed By: pedroerp Differential Revision: D72997442 Pulled By: kKPulla fbshipit-source-id: 5fcf40639ed0af63e6ec198994aeaef49ba367cb
Description
Part of #24087
Motivation and Context
Fix incorrect data caused by overflow, and correct the type mapping in certain operators.
Impact
Where previously some expressions could have resulted in an overflow and incorrect results, now they will fail with a
NUMERIC_VALUE_OUT_OF_RANGEerror.Test Plan
Unit tests
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.