You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/12/02 20:50:18 UTC
[GitHub] [arrow-rs] bjchambers commented on issue #3261: `nullif` panics on empty array
bjchambers commented on issue #3261:
URL: https://github.com/apache/arrow-rs/issues/3261#issuecomment-1335833184
@tustvold In debugging, it looks like it still executes the closure in the bitwise unary operator once, and in my case it had 64 ones, so it incremented the valid count by 64. But then `len - valid_count` causes a panic.
```
None => {
let buffer = arrow::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
}
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org