fix(cast): correct scientific notation string to decimal parsing (#63085)#63135
Open
leonard9893 wants to merge 2 commits into
Open
fix(cast): correct scientific notation string to decimal parsing (#63085)#63135leonard9893 wants to merge 2 commits into
leonard9893 wants to merge 2 commits into
Conversation
…x instead of reused loop variable i Signed-off-by: leonard9893 <leonard9893@gmail.com>
…ction Signed-off-by: leonard9893 <leonard9893@gmail.com>
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Author
|
Hi @apache/doris-committers, this PR fixes a regression in DECIMAL parsing of scientific notation introduced by #60004.
The fix is a one-line change replacing reused |
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.
Problem
CAST('1.4E+4' AS DECIMAL(38, 15))returns 14.000... instead of 14000.000... in Doris 4.0.5 (regression from 2.1).Root Cause
be/src/util/string_parser.cpp—string_to_decimalfunction at line 191 uses a loop variableithat was contaminated by the exponent parsing loop, instead of the preservedend_digit_index.Introduced by commit c108263.
Fix
Replace
iwithend_digit_indexon line 191.Fixes #63085