forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-34909: [C++] Avoid mean overflow on large integer inputs (ap…
…ache#37243) ### Rationale for this change The `mean` aggregate function would overflow if the input array's sum is larger than int64_max. ### What changes are included in this PR? Store intermediate sum in double instead of int64, so that it won't overflow. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: apache#34909 Authored-by: Jin Shang <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
- Loading branch information
Showing
2 changed files
with
52 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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