Merged
Conversation
Contributor
Author
|
Will add interval tests shortly, realise I forgot |
Contributor
Should I wait to review this PR until you wrote those tests? Or did you add them to #4493 ? |
alamb
approved these changes
Jul 10, 2023
arrow-arith/src/numeric.rs
Outdated
| }}; | ||
| } | ||
|
|
||
| /// Perform `!array`, returning an error on overflow |
Contributor
There was a problem hiding this comment.
Suggested change
| /// Perform `!array`, returning an error on overflow | |
| /// Negates each element of `array`, returning an error on overflow |
I am not really sure what "Performs !array" means
arrow-arith/src/numeric.rs
Outdated
| /// Perform `!array`, returning an error on overflow | ||
| /// | ||
| /// Note: negation of unsigned arrays is not supported and will return in an error, | ||
| /// for wrapping unsigned negation consider using [`neg_wrapping()`] |
Contributor
There was a problem hiding this comment.
Suggested change
| /// for wrapping unsigned negation consider using [`neg_wrapping()`] | |
| /// for wrapping unsigned negation consider using [`neg_wrapping`] |
Contributor
Author
There was a problem hiding this comment.
This is necessary to avoid ambiguity, will change to a link
Contributor
There was a problem hiding this comment.
sorry it just looked strange to me
arrow-arith/src/numeric.rs
Outdated
| } | ||
| } | ||
|
|
||
| /// Perform `!array`, wrapping on overflow for [`DataType::is_integer`] |
Contributor
There was a problem hiding this comment.
Suggested change
| /// Perform `!array`, wrapping on overflow for [`DataType::is_integer`] | |
| /// Negates each element of `array` , wrapping on overflow for [`DataType::is_integer`] |
| Duration(Millisecond) => neg_checked!(DurationMillisecondType, array), | ||
| Duration(Microsecond) => neg_checked!(DurationMicrosecondType, array), | ||
| Duration(Nanosecond) => neg_checked!(DurationNanosecondType, array), | ||
| Interval(YearMonth) => neg_checked!(IntervalYearMonthType, array), |
Contributor
There was a problem hiding this comment.
I double checked that YearMonth intervals are stored as number of whole intervals and thus don't need to be treated field by field
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?
Closes #4488
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?