goel-skd opened a new pull request, #50261:
URL: https://github.com/apache/arrow/pull/50261
### Rationale for this change
`Array` and `ArrayData` expose `ComputeLogicalNullCount()`, which counts
logical nulls for types that carry them without a validity bitmap (e.g. unions
and run-end encoded arrays).
`ChunkedArray` only exposed `null_count()`, which does not account for
those logical nulls, so callers had to hand-roll a loop over the chunks. This
PR closes that gap.
### What changes are included in this PR?
Add `ChunkedArray::ComputeLogicalNullCount()`, returning the sum of
`Array::ComputeLogicalNullCount()` over the chunks. As with the `Array`level
method, the value is recomputed on each call rather than cached.
### Are these changes tested?
Yes. A new `TestChunkedArray.ComputeLogicalNullCount` test covers three
cases:
- a type with a validity bitmap (result matches `null_count()`),
- an empty chunked array, and,
- a run-end encoded chunked array (where `null_count()` is 0 but the logical
null count is not).
### Are there any user-facing changes?
Yes, this adds a new public method,
`ChunkedArray::ComputeLogicalNullCount()`. The change is purely additive; no
existing APIs are modified.
--
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]