alamb commented on code in PR #9074:
URL: https://github.com/apache/arrow-rs/pull/9074#discussion_r2655359208
##########
arrow-select/src/nullif.rs:
##########
@@ -72,40 +71,20 @@ pub fn nullif(left: &dyn Array, right: &BooleanArray) ->
Result<ArrayRef, ArrowE
// Compute left null bitmap & !right
- let (combined, null_count) = match left_data.nulls() {
- Some(left) => {
- let mut valid_count = 0;
- let b = bitwise_bin_op_helper(
- left.buffer(),
- left.offset(),
- right.inner(),
- right.offset(),
- len,
- |l, r| {
- let t = l & !r;
- valid_count += t.count_ones() as usize;
- t
- },
- );
- (b, len - valid_count)
- }
- None => {
- let mut null_count = 0;
- let buffer =
- BooleanBuffer::from_bitwise_unary_op(right.inner(),
right.offset(), len, |b| {
- let t = !b;
- null_count += t.count_zeros() as usize;
- t
- })
- .into_inner();
- (buffer, null_count)
- }
+ let combined = if let Some(left) = left_data.nulls() {
Review Comment:
Since the new optimized `from_bitwise_binary_op` may call `op` outside of
the set bits, we need to avoid also trying to count the ones within the first
pass.
--
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]