[VL] Support ANSI mode decimal Add/Subtract with checked overflow#11705
Draft
n0r0shi wants to merge 1 commit intoapache:mainfrom
Draft
[VL] Support ANSI mode decimal Add/Subtract with checked overflow#11705n0r0shi wants to merge 1 commit intoapache:mainfrom
n0r0shi wants to merge 1 commit intoapache:mainfrom
Conversation
Routes decimal `Add` and `Subtract` to Velox's `checked_add` and `checked_subtract` functions when ANSI mode is enabled (`nullOnOverflow = false`). These checked variants throw on overflow instead of returning null, matching Spark's ANSI behavior. Depends on facebookincubator/velox#16302 which adds `checked_add` and `checked_subtract` support for decimal types.
|
Run Gluten Clickhouse CI on x86 |
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.
Summary
AddandSubtractto Velox'schecked_addandchecked_subtractwhen ANSI mode is enabled (nullOnOverflow = falseinCheckOverflow), so overflow throws instead of returning null.Add/Subtractusing thetry(checked_add/checked_subtract)pattern, consistent with how integer TRY arithmetic is already handled.tryCastinCheckOverflowTransformerto detect overflow. This change uses the consistenttry(checked_*)pattern instead.Dependencies
checked_addandchecked_subtractsupport for decimal types.oss-mainbut not yet on thedft-branch Gluten pins to. The ANSI overflow tests will pass after the next Velox version bump inget-velox.sh.Test plan
try_add/try_subtractwith decimals returns null on overflow