tustvold commented on code in PR #3590:
URL: https://github.com/apache/arrow-rs/pull/3590#discussion_r1084526356
##########
arrow-select/src/nullif.rs:
##########
@@ -68,43 +68,41 @@ pub fn nullif(left: &dyn Array, right: &BooleanArray) ->
Result<ArrayRef, ArrowE
};
// Compute left null bitmap & !right
- let mut valid_count = 0;
- let combined = match left_data.null_buffer() {
+
+ let (combined, null_count) = match left_data.null_buffer() {
Some(left) => {
- bitwise_bin_op_helper(left, left_offset, &right, right_offset,
len, |l, r| {
- let t = l & !r;
- valid_count += t.count_ones() as usize;
- t
- })
+ let mut valid_count = 0;
+ let b =
+ bitwise_bin_op_helper(left, l_offset, &right, r_offset, len,
|l, r| {
+ let t = l & !r;
+ valid_count += t.count_ones() as usize;
+ t
+ });
+ (b, len - valid_count)
}
None => {
- let buffer = bitwise_unary_op_helper(&right, right_offset, len,
|b| {
+ let mut null_count = 0;
+ let buffer = bitwise_unary_op_helper(&right, r_offset, len, |b| {
let t = !b;
- valid_count += t.count_ones() as usize;
+ null_count += t.count_zeros() as usize;
Review Comment:
Nope, we instead exploit the property that the remainder bits will always be 0
--
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]