Dandandan opened a new pull request, #21337:
URL: https://github.com/apache/datafusion/pull/21337

   ## Which issue does this PR close?
   
   N/A - minor optimization
   
   ## Rationale for this change
   
   `BooleanArray::has_true()` and `has_false()` (added in arrow 58.1.0) can 
short-circuit on the first matching value instead of counting all set bits. 
This is more efficient when only checking for the presence/absence of 
true/false values.
   
   ## What changes are included in this PR?
   
   Replace `true_count() == 0`, `true_count() > 0`, `false_count() == 0`, 
`true_count() == len`, and `false_count() == len` patterns with 
`has_true()`/`has_false()` in 6 files where the actual count value is not 
needed:
   
   - `nested_loop_join.rs` - 2 sites
   - `array_has.rs` - 1 site  
   - `metadata.rs` - 5 sites
   - `replace.rs` - 1 site
   - `sort_merge_join/filter.rs` - 1 site
   - `array_contains.rs` (spark) - 1 site
   
   Cases where the count is used as a value (arithmetic, passed to functions, 
etc.) are left unchanged.
   
   ## 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]

Reply via email to