Smallfu666 opened a new pull request, #12605: URL: https://github.com/apache/gluten/pull/12605
## What changes are proposed in this pull request? Fixes #12356. Velox converts a long decimal's unscaled `int128` value to `double` before applying the decimal scale. For values whose unscaled representation exceeds the precision of `double`, this can produce a result that differs from Spark. This patch keeps the workaround Velox-specific and: - converts long decimals (precision greater than 18) through their exact string representation before casting to `double`; - adds a regression test for the reported decimal-division query with constant folding disabled and `spark.sql.decimalOperations.allowPrecisionLoss=false`; - verifies that the expression remains offloaded through `ProjectExecTransformer`. ## How was this patch tested? - Reproduced the issue on current `main` with Spark 3.5: vanilla Spark returned `214.4`, while Gluten/Velox returned `214.39999999999998`. - Ran `MathFunctionsValidateSuite` and its ANSI variant with the Velox backend: 44 tests passed, 0 failed. - Ran Scala formatting and `git diff --check`. ## Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex GPT-5.6 Luna -- 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]
