Dandandan opened a new pull request, #21338: URL: https://github.com/apache/datafusion/pull/21338
## Which issue does this PR close? N/A - minor optimization ## Rationale for this change `arrow::compute::and()` operates on `BooleanArray` and includes null-handling overhead (computing output null buffer). In many cases, we can use `BooleanBuffer` bitwise operations (`&`, `&=`) directly, which: - Avoids allocating intermediate `BooleanArray`s with null buffers - Enables in-place accumulation with `&=` (no new allocation per iteration) - Is simpler when inputs are known to have no nulls (e.g., `is_not_null()` results) ## What changes are included in this PR? Replace `arrow::compute::and()` with `BooleanBuffer` bitwise operations in 5 files: - **`catalog/table.rs`**: Filter mask accumulation loop → `BooleanBuffer &=` in-place - **`joins/utils.rs`**: Equality result fold → explicit loop with `BooleanBuffer &=` - **`metadata.rs`**: Combining eq/exactness masks → `BooleanBuffer &` - **`correlation.rs`**: Combining `is_not_null()` results → `values() & values()` (no nulls) - **`approx_percentile_cont_with_weight.rs`**: Same `is_not_null()` pattern Where inputs may have nulls (filters, eq results), null values are converted to false at the buffer level via `values() & nulls.inner()` before combining. ## Are these changes tested? Existing tests cover these code paths. ## Are there any user-facing changes? No. 🤖 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
