Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.0.1
Description
>>> pa.compute.sum(pa.array([], pa.int64())) <pyarrow.Int64Scalar: None>
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.
Attachments
Issue Links
- links to