[VL] Support ANSI and TRY mode for decimal Add/Subtract/Multiply#12192
Open
n0r0shi wants to merge 1 commit into
Open
[VL] Support ANSI and TRY mode for decimal Add/Subtract/Multiply#12192n0r0shi wants to merge 1 commit into
n0r0shi wants to merge 1 commit into
Conversation
|
Run Gluten Clickhouse CI on x86 |
4 tasks
Author
|
@baibaichen this is a sub-task of #10134; wires Velox's now-merged |
Routes decimal Add, Subtract, and Multiply to Velox's checked_add, checked_subtract, and checked_multiply functions for both ANSI and TRY eval modes: - ANSI mode (nullOnOverflow=false): checked_* throw on overflow, matching Spark's ANSI behavior. - TRY mode: try(checked_*) returns null on overflow, using the same try(checked_*) pattern as integer arithmetic. Previously, TRY mode for decimal arithmetic relied on a tryCast in CheckOverflowTransformer to detect overflow. This change uses the consistent try(checked_*) pattern instead. Depends on: - facebookincubator/velox#16302 — checked_add and checked_subtract for decimal types (merged) - facebookincubator/velox#16307 — checked_multiply for decimal types (merged)
61c39ac to
6d0f17f
Compare
|
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
Routes decimal
Add,Subtract, andMultiplyto Velox'schecked_add,checked_subtract, andchecked_multiplyfor both ANSI and TRY eval modes:nullOnOverflow=false):checked_*throw on overflow, matching Spark's ANSI behavior.try(checked_*)returns null on overflow, using the sametry(checked_*)pattern as integer arithmetic.Previously, TRY mode for decimal arithmetic relied on a
tryCastinCheckOverflowTransformerto detect overflow. This change uses the consistenttry(checked_*)pattern instead.Dependencies
checked_add/checked_subtractfor decimal types (merged)checked_multiplyfor decimal types (merged)Context
This supersedes #11705 (stale-closed draft). Rebased on current main; force-push of the same branch broke the reopen path, so opening as a new PR.
Scope extended to include Multiply (vs original Add/Subtract only) since #16307 is also merged.
How was this patch tested?
ArithmeticAnsiValidateSuite(new) covers ANSI + TRY mode for decimal Add/Subtract/Multiply.