[bug](function) fix conv function get wrong result as parse overflow #38001
Merged
HappenLee merged 3 commits intoapache:masterfrom Jul 24, 2024
Merged
[bug](function) fix conv function get wrong result as parse overflow #38001HappenLee merged 3 commits intoapache:masterfrom
HappenLee merged 3 commits intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
Contributor
Author
|
run buildall |
Contributor
|
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 |
Contributor
Author
|
run buildall |
Contributor
|
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 |
zclllyybb
approved these changes
Jul 23, 2024
Contributor
zclllyybb
left a comment
There was a problem hiding this comment.
LGTM. please also raise a pr to docs to clarify the function behaviour
Contributor
|
PR approved by anyone and no changes requested. |
Contributor
Author
|
run buildall |
Contributor
|
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 |
Contributor
|
PR approved by at least one committer and no changes requested. |
zhangstar333
added a commit
to zhangstar333/incubator-doris
that referenced
this pull request
Jul 24, 2024
…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 ```
dataroaring
pushed a commit
that referenced
this pull request
Jul 24, 2024
…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 ```
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes