Adds support for ANSI mode in negative function#20189
Merged
comphead merged 5 commits intoapache:mainfrom Feb 14, 2026
Merged
Conversation
comphead
reviewed
Feb 6, 2026
Contributor
comphead
left a comment
There was a problem hiding this comment.
Thanks @SubhamSinghal I'll check it soon, however ansi mode now makes me think how to better structure tests. What I mean is ANSI edge cases are rare and most of cases should have same results no matter of ANSI flag. That can generate test scenarios duplication which would be nice to avoid
Contributor
Author
|
@comphead Modified UTs to contain only overflow tests in ANSI mode. |
comphead
reviewed
Feb 7, 2026
| let result: PrimitiveArray<Int8Type> = if enable_ansi_mode { | ||
| array.try_unary(|x| { | ||
| x.checked_neg().ok_or_else(|| { | ||
| ArrowError::ComputeError(format!( |
Contributor
There was a problem hiding this comment.
lets use
exec_err! to be in sync with other functions
Contributor
Author
Contributor
There was a problem hiding this comment.
Arrow::ComputeError is for errors happening inside Arrow kernels, and here I believe is checked_neg from core::num ?
comphead
reviewed
Feb 7, 2026
added 3 commits
February 13, 2026 22:30
de-bgunter
pushed a commit
to de-bgunter/datafusion
that referenced
this pull request
Mar 24, 2026
## Which issue does this PR close? apache#20034 ## Rationale for this change ANSI mode support for negative function ## What changes are included in this PR? Added support for ANSI mode for negative function ## Are these changes tested? yes through UT ## Are there any user-facing changes? yes, adds ANSI support to existing function. --------- Co-authored-by: Subham Singhal <subhamsinghal@Subhams-MacBook-Air.local>
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.
Which issue does this PR close?
#20034
Rationale for this change
ANSI mode support for negative function
What changes are included in this PR?
Added support for ANSI mode for negative function
Are these changes tested?
yes through UT
Are there any user-facing changes?
yes, adds ANSI support to existing function.