goel-skd opened a new pull request, #50770: URL: https://github.com/apache/arrow/pull/50770
### Rationale for this change The dictionary of a `dictionary(..., null())` array is a `NullArray`, which reports `null_count == length` but has no validity bitmap. `dict_util::LogicalNullCount` only skipped its per-index scan when the dictionary's null count was 0, so for these arrays the scan read through a null bitmap pointer and crashed. ### What changes are included in this PR? Return the array's length when the dictionary has nulls but no validity bitmap. Every value in such a dictionary is null, so there is nothing to scan. ### Are these changes tested? Yes, in `TestArray.TestNullCount` for all index types, and in `TestArray.TestSlicePreservesAllNullCount` for a slice. Two of the new cases crash without the fix. ### Are there any user-facing changes? `ComputeLogicalNullCount()` no longer crashes on these arrays, and neither does the `count` kernel, which calls it. **This PR contains a "Critical Fix".** It fixes a crash on valid input. -- 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]
