alamb opened a new pull request, #10049: URL: https://github.com/apache/arrow-rs/pull/10049
# Which issue does this PR close? N/A — follow-up cleanup from the recent filter null-buffer work (#9986). # Rationale for this change `arrow-select` had two near-identical ways to compute a filtered null mask: - a private free function `filter_null_mask(nulls, predicate) -> Option<(usize, Buffer)>` - the public method `FilterPredicate::filter_nulls(nulls) -> Option<NullBuffer>` (added in #9986), which just wrapped the free function's result Every caller of `filter_null_mask` immediately turned its `(usize, Buffer)` result back into a `NullBuffer` via the same `unsafe NullBuffer::new_unchecked(BooleanBuffer::new(nulls, 0, count), null_count)` incantation. That duplicated `unsafe` boilerplate at each site and left two overlapping helpers, making the logic harder to find and reuse. This PR collapses them into a single, discoverable method. # What changes are included in this PR? - Fold the body of the free `filter_null_mask` into `FilterPredicate::filter_nulls`, which already returns `Option<NullBuffer>`. - Remove the now-redundant private `filter_null_mask` function. - Update `filter_struct` to call `predicate.filter_nulls(array.nulls())`, dropping its hand-rolled `unsafe` null-buffer construction. Note: `filter_null_mask` was a private (module-local) function, never part of the public API, so no deprecation is required — see discussion below. # Are these changes tested? Covered by existing `arrow-select` filter tests (all 60 `filter` lib tests pass, including `test_filter_struct`, `test_null_mask`, and the filter fuzz tests). No behavior change. # Are there any user-facing changes? No. `filter_null_mask` was private; the public `FilterPredicate::filter_nulls` keeps the same signature and semantics. -- 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]
