jacktengg opened a new pull request, #70535: URL: https://github.com/apache/doris/pull/70535
### What problem does this PR solve? Issue Number: N/A Related PR: #67463 Backport of #67463 to `branch-4.2`, cherry-picked from `cf1a553731a84a06b62391518ef42199bbb6718f` with source attribution (`-x`). This branch is based directly on `apache/doris:branch-4.2` and is independent of the other backports. Large scaled Float/Double values could produce an out-of-range intermediate during Decimal256 conversion and trigger undefined floating-point-to-integer conversion. Decode IEEE-754 binary64 values into the wide integer outside the safe int64 fast path and promote Float32 values exactly to that implementation. ### Branch-4.2 adaptations Kept the 4.2 compile-check guards around wide_integer_impl.h. The master-only wide_integer_from_double.cpp translation unit and its PCH/unity-build entries do not exist on 4.2, so no CMake changes or unrelated unity-build configuration are introduced. The conversion implementation otherwise matches the merged source commit. ### Release note Fix unstable Float and Double to Decimal256 cast results while preserving the int64 conversion fast path. ### Validation - Verified that wide_integer_impl.h matches the source commit apart from the existing 4.2 compile-check guards. - Verified that the new floating-point conversion tests and updated regression expected output match the merged source commit exactly. - Whitespace/conflict-marker checks passed (allowing the standard trailing blank line in regression `.out` files). - Exactly one backport commit on top of `7523405f6aa8e9df3d110eb432fed1ff6e1c3418`; clean worktree. - Full builds, unit tests and SQL regression suites were not run for this backport on this macOS host. The local environment lacks the required JDK 17/full Doris build dependencies; the offline Maven attempt could not resolve the required BOMs. Submodules remain uninitialized. WideInteger.FloatingPointConversions and the original Decimal256 regression expectation updates are included. ### Check List (For Author) - Test: existing upstream unit/regression coverage included; local checks and execution limits are listed above. - Behavior changed: Yes; restores correct behavior as described above. - Does this need documentation: No. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
