[
https://issues.apache.org/jira/browse/ARROW-12911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17354738#comment-17354738
]
Yibo Cai commented on ARROW-12911:
----------------------------------
According [PR|https://github.com/apache/arrow/pull/9758] is not included in 4.0
release. So this {{min_count}} options may only be available in next release.
> sum of zero rows gives null; should give 0
> ------------------------------------------
>
> Key: ARROW-12911
> URL: https://issues.apache.org/jira/browse/ARROW-12911
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++, Python
> Affects Versions: 4.0.1
> Reporter: Adam Hooper
> Priority: Minor
>
> {code}
> >>> pa.compute.sum(pa.array([], pa.int64()))
> <pyarrow.Int64Scalar: None>
> {code}
> I'd expect 0.
> I can't think of any reason for NULL, except that SQL returns NULL. But I
> can't figure out why SQL returns NULL. Does anybody know? Any textbook -- and
> https://en.wikipedia.org/wiki/Summation -- specifies 0.
> Pandas and Numpy return 0. Also, Apache Arrow c_glib implementation returns 0
> -- and even tests for it:
> https://github.com/apache/arrow/blob/master/c_glib/test/test-int8-array.rb#L60
> Workaround is to replace all NULLs with 0 after running the computation.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)