viirya commented on code in PR #3034:
URL: https://github.com/apache/arrow-rs/pull/3034#discussion_r1014894152
##########
arrow/src/compute/kernels/boolean.rs:
##########
@@ -522,11 +522,19 @@ pub fn nullif(left: &dyn Array, right: &BooleanArray) ->
Result<ArrayRef> {
t
})
}
- None => bitwise_unary_op_helper(&right, right_offset, len, |b| {
- let t = !b;
- valid_count += t.count_ones() as usize;
- t
- }),
+ None => {
+ let buffer = bitwise_unary_op_helper(&right, right_offset, len,
|b| {
+ let t = !b;
+ valid_count += t.count_ones() as usize;
+ t
+ });
+ // We need to compensate for the additional bits read from the end
+ let remainder_len = len % 64;
+ if remainder_len != 0 {
+ valid_count -= 64 - remainder_len
+ }
+ buffer
Review Comment:
Should we also compensate valid_count for left_data.null_buffer() is Some
case?
--
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]