viirya opened a new pull request, #11378: URL: https://github.com/apache/arrow-rs/pull/11378
# Which issue does this PR close? Closes #11377. # Rationale for this change Direct calls to the public `FilterPredicate::filter_nulls` panic when an input contains nulls and the predicate selects all rows or no rows. Both strategies reach an `unreachable!()` in `filter_bits`. # What changes are included in this PR? Handle both strategies in `filter_nulls`: return `None` for an empty selection, and slice the input to the predicate's length for an all-row selection, returning `None` if the slice has no nulls. Preserve and document the existing length check for inputs containing nulls. # Are these changes tested? Added regressions that reproduced both panics before the fix, plus coverage for shorter predicates, a selected prefix without nulls, nonzero bitmap offsets, empty predicates, general iteration strategies with and without optimization, and existing length-check behavior. Validation (Cargo builds and tests used the company crates proxy): - `cargo test -p arrow-select`: 432 unit tests and 17 doc tests passed. - `cargo clippy -p arrow-select --all-targets --all-features -- -D warnings`: passed. - `cargo +stable fmt --all -- --check` and `git diff --check`: passed. # Are there any user-facing changes? Valid all-row and no-row predicates no longer panic in `filter_nulls`. No public signatures change. AI assistance was used to investigate the defect, implement the fix, write regression tests, and draft this description. The resulting diff was reviewed and the checks above were run. -- 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]
