-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-35789: [C++] Remove check_overflow from CumulativeSumOptions #35790
Conversation
|
This does not seem to make sense to me, is there a typo? |
Regardless, the unused option is misleading, so I agree with removing it. |
Sorry! It's a typo indeed. I meant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @js8544 . Let's just wait for CI now.
bcef039
to
c6b945a
Compare
The CI failure looks weird. I pushed an empty commit to trigger a rerun. |
The CI failure was probably unrelated, but let's wait for it. |
Benchmark runs are scheduled for baseline = e0fd7ef and contender = d20a1d1. d20a1d1 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
['Python', 'R'] benchmarks have high level of regressions. |
Rationale for this change
There are two variants of cumsum,
cumulative_sum
always wraps around on overflow andcumulative_sum_checked
always returnStatus::Invalid
on overflow, regardless of thecheck_overflow
parameter in CumulativeSumOptions.For example:
I believe it's more of a ambiguity rather than a bug. The document of
cumulative_sum
also doesn't mentioncheck_overflow
at all, andcheck_overflow
is not exposed to pyarrow. So IMO the best approach to avoid confusion is to removecheck_overflow
from CumulativeSumOptions.The only place where
check_overflow
is used is in the C++ convenience functionCumulativeSum
defined in api_vector.h, which callscumulative_sum_checked
orcumulative_sum
depending on the parameter. It can be replaced by a bool parameter in the C++ convenience function.What changes are included in this PR?
check_overflow
is removed from CumulativeSumOptions.Are these changes tested?
It doesn't affect the current tests.
Are there any user-facing changes?
Yes, but only the C++ convenience function because check_overflow is not used in the kernel implementation and not exposed to pyarrow anyways.