tustvold commented on code in PR #3034:
URL: https://github.com/apache/arrow-rs/pull/3034#discussion_r1014907849
##########
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:
Shouldn't need to as remainder u64 is masked to be 0 in the trailing
positions, which when and-ed will not yield valid bits
--
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]