tustvold commented on code in PR #3885:
URL: https://github.com/apache/arrow-rs/pull/3885#discussion_r1140551043
##########
arrow-arith/src/arity.rs:
##########
@@ -220,11 +215,7 @@ where
return Ok(PrimitiveArray::from(ArrayData::new_empty(&O::DATA_TYPE)));
}
- let null_buffer = combine_option_bitmap(&[a.data(), b.data()], len);
- let null_count = null_buffer
- .as_ref()
- .map(|x| len - x.count_set_bits_offset(0, len))
- .unwrap_or_default();
+ let nulls = NullBuffer::union(a.nulls(), b.nulls());
Review Comment:
Not only is this less code, but it can now preserve the source null buffers
even if they have an offset
##########
arrow-arith/src/arity.rs:
##########
@@ -220,11 +215,7 @@ where
return Ok(PrimitiveArray::from(ArrayData::new_empty(&O::DATA_TYPE)));
}
- let null_buffer = combine_option_bitmap(&[a.data(), b.data()], len);
- let null_count = null_buffer
- .as_ref()
- .map(|x| len - x.count_set_bits_offset(0, len))
- .unwrap_or_default();
+ let nulls = NullBuffer::union(a.data().nulls(), b.data().nulls());
Review Comment:
Not only is this less code, but it can now preserve the source null buffers
even if they have an offset
--
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]