-
Notifications
You must be signed in to change notification settings - Fork 3.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
[bug](function) fix conv function get wrong result as parse overflow #38001
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 39869 ms
|
TPC-DS: Total hot run time: 173013 ms
|
ClickBench: Total hot run time: 30.51 s
|
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 39789 ms
|
TPC-DS: Total hot run time: 173863 ms
|
ClickBench: Total hot run time: 30.42 s
|
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. please also raise a pr to docs to clarify the function behaviour
PR approved by anyone and no changes requested. |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
TPC-H: Total hot run time: 40026 ms
|
TPC-DS: Total hot run time: 174250 ms
|
ClickBench: Total hot run time: 29.8 s
|
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
PR approved by at least one committer and no changes requested. |
…pache#38001) ``` mysql> select conv('ffffffffffffff', 24, 2); +------------------------------------------------------------------+ | conv('ffffffffffffff', 24, 2) | +------------------------------------------------------------------+ | 1111111111111111111111111111111111111111111111111111111111111111 | +------------------------------------------------------------------+ before get wrong result as 'ffffffffffffff' have beyond the max value of int64, so get max value: std::numeric_limits<int64_t>::max() mysql> select conv('ffffffffffffff', 24, 2); +------------------------------------------------------------------+ | conv('ffffffffffffff', 24, 2) | +------------------------------------------------------------------+ | 1011111001100011011111100110111101001101111010011011110100110111 | +------------------------------------------------------------------+ now change it to parse as uint64_t could get result. But if the value is still overflow, will get max value of uint64_t ```
…38001) ``` mysql> select conv('ffffffffffffff', 24, 2); +------------------------------------------------------------------+ | conv('ffffffffffffff', 24, 2) | +------------------------------------------------------------------+ | 1111111111111111111111111111111111111111111111111111111111111111 | +------------------------------------------------------------------+ before get wrong result as 'ffffffffffffff' have beyond the max value of int64, so get max value: std::numeric_limits<int64_t>::max() mysql> select conv('ffffffffffffff', 24, 2); +------------------------------------------------------------------+ | conv('ffffffffffffff', 24, 2) | +------------------------------------------------------------------+ | 1011111001100011011111100110111101001101111010011011110100110111 | +------------------------------------------------------------------+ now change it to parse as uint64_t could get result. But if the value is still overflow, will get max value of uint64_t ```
Proposed changes