wForget commented on PR #7159:
URL: https://github.com/apache/arrow-rs/pull/7159#issuecomment-2683729216
> FWIW the current behaviour is consistent with postgres
`add` and `add_wrapping` also have different behaviors in arrow.
```
#[test]
fn test_integer_add() {
let a = Int32Array::from(vec![-2147483648]);
let b = Int32Array::from(vec![-1]);
let err = add(&a, &b).unwrap_err().to_string();
assert_eq!(err, "Arithmetic overflow: Overflow happened on:
-2147483648 + -1");
let result_on_add_wrapping = add_wrapping(&a, &b).unwrap();
assert_eq!(
result_on_add_wrapping.as_ref(),
&Int32Array::from(vec![2147483647])
);
}
```
--
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]