[fix](decimal) Fix scientific string cast to decimal and rounding for very small scientific-notation values#63119
[fix](decimal) Fix scientific string cast to decimal and rounding for very small scientific-notation values#63119jacktengg wants to merge 1 commit intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
/review |
There was a problem hiding this comment.
Automated review completed. I did not find blocking issues in the actual PR diff, which is limited to decimal scientific-notation parsing and associated tests. The change keeps the parser scope focused, adds coverage for positive/negative exponents and rounding around the target scale, and preserves failure handling for malformed exponents.\n\nCritical checkpoint conclusions:\n- Goal/test coverage: Implements decimal scientific-notation parsing fixes and adds BE unit tests for representative parsing and rounding cases.\n- Scope: Small and focused on plus tests.\n- Concurrency/lifecycle/config/compatibility: Not applicable; no shared state, lifecycle, config, persistence, or wire/storage format changes in the actual PR patch.\n- Data correctness: Reviewed exponent decimal-point shifting, fractional padding, rounding carry, and overflow/underflow checks; no confirmed defect found.\n- Error handling: Malformed exponent suffixes still return parse failure; exponent overflow returns parse overflow.\n- Performance/memory: No new allocations or hot-path complexity beyond existing linear parsing; no MemTracker concern for this utility path.\n- User focus: No additional user-provided review focus was present.
There was a problem hiding this comment.
Automated review completed. I did not find blocking issues in the actual PR diff, which is limited to decimal scientific-notation parsing and associated tests. The change keeps the parser scope focused, adds coverage for positive/negative exponents and rounding around the target scale, and preserves failure handling for malformed exponents.
Critical checkpoint conclusions:
- Goal/test coverage: Implements decimal scientific-notation parsing fixes and adds BE unit tests for representative parsing and rounding cases.
- Scope: Small and focused on StringParser::string_to_decimal plus tests.
- Concurrency/lifecycle/config/compatibility: Not applicable; no shared state, lifecycle, config, persistence, or wire/storage format changes in the actual PR patch.
- Data correctness: Reviewed exponent decimal-point shifting, fractional padding, rounding carry, and overflow/underflow checks; no confirmed defect found.
- Error handling: Malformed exponent suffixes still return parse failure; exponent overflow returns parse overflow.
- Performance/memory: No new allocations or hot-path complexity beyond existing linear parsing; no MemTracker concern for this utility path.
- User focus: No additional user-provided review focus was present.
|
run buildall |
ad2828f to
3e39b7e
Compare
|
run buildall |
TPC-H: Total hot run time: 29251 ms |
TPC-DS: Total hot run time: 170689 ms |
… very small scientific-notation values Problems: 1. String-to-decimal casting counted exponent characters as significand digits, so values such as "1.4E+2" could miss the exponent scale and return 14 instead of 140. 2. String-to-decimal parsing rounded scientific-notation values up even when implicit zeros placed the significant digit beyond the first discarded decimal scale position. Also add comments to help understand the code.
3e39b7e to
8d5d793
Compare
|
run buildall |
What problem does this PR solve?
Issue Number: close #xxx
Related PR: Bug introduced by #60004
Problem Summary:
Also add comments to help understand the code.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)