js8544 opened a new issue, #35789:
URL: https://github.com/apache/arrow/issues/35789
### Describe the bug, including details regarding any error messages,
version, and platform.
There are two variants of cumsum, `cumulative_sum` always wraps around on
overflow and `cumulative_sum` always return `Status::Invalid` on overflow,
regardless of the `check_overflow` parameter in CumulativeSumOptions.
For example:
```cpp
CumulativeSumOptions options(/*start=*/0, /*skip_nulls=*/true,
/*check_overflow=*/true);
auto res = CallFunction("cumulative_sum", {ArrayFromJSON(int8(), "[127,
1]")}, &options);
std::cout << res->make_array()->ToString() << std::endl;
// prints [127, -128], but user might expect an error returned.
```
The document of `cumulative_sum` also doesn't memtion `check_overflow` at
all, and `check_overflow` is not exposed to pyarrow. So I believe the best
approach to avoid confusion is to remove `check_overflow` from
CumulativeSumOptions.
The only place where `check_overflow` is used is in the convenience function
`CumulativeSum` defined in api_vector.h, which calls `cumulative_sum_checked`
or `cumulative_sum` depending on the parameter. It can be replaced by a bool
parameter in the convenience function.
### Component(s)
C++
--
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]