mzabaluev-flarion opened a new pull request, #11866: URL: https://github.com/apache/arrow-rs/pull/11866
# Which issue does this PR close? - Part of #11839 **Stacked on #11844.** This branch contains that PR's commit, so only the last commit, "native filter kernel for Map", is new here. It doesn't depend on #11865. # Rationale for this change `filter` on `Map` arrays falls back to `MutableArrayData`, which calls `try_extend` once per selected row range and runs the boxed extend closure of every descendant array. # What changes are included in this PR? `filter_map` reuses `filter_offsets` from #11844 to compute the new offsets and a predicate over the selected entries. It filters the entries with `filter_struct` and validity with `FilterPredicate::filter_nulls`. The entries keep their fields, so the keys column stays non-nullable. # Are these changes tested? New tests compare `filter`, with and without `optimize()`, against `take` and run `validate_full` on the result. They cover: - null maps, empty maps, and selections of only empty or null maps - sliced maps - a `List<Map>` - a fuzz test with random slicing and selectivity The existing `test_filter_map` passes unchanged. Benchmarks from #11841, compared against `main` (Apple M4 Pro): | case | kept 1/2 | kept 1023/1024 | kept 1/1024 | |---|---|---|---| | map\<utf8, i64\> w NULLs | −53% | −81% | −43% | | context map\<utf8, i64\> w NULLs | −57% | −81% | −63% | # Are there any significant user-facing changes? No. The public API and the output of `filter` are unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
