tustvold commented on code in PR #2780:
URL: https://github.com/apache/arrow-rs/pull/2780#discussion_r980257948
##########
arrow/src/compute/kernels/aggregate.rs:
##########
@@ -124,10 +124,7 @@ where
.map(|i| unsafe { array.value_unchecked(i) })
.reduce(|acc, item| if cmp(&acc, &item) { item } else { acc })
} else {
- let null_buffer = array
- .data_ref()
- .null_buffer()
- .map(|b| b.bit_slice(array.offset(), array.len()));
+ let null_buffer = array.data_ref().null_buffer();
Review Comment:
As an added bonus this will be faster. The bug is that BitIndexIterator is
already applying the offset, and so it gets applied twice and we iterate a
somewhat arbitrary part of the null mask.
(Note the way BitIndexIterator is written is that len acts to truncate the
iteration, if len exceeds the data it doesn't panic, perhaps it should)
##########
arrow/src/compute/kernels/aggregate.rs:
##########
@@ -124,10 +124,7 @@ where
.map(|i| unsafe { array.value_unchecked(i) })
.reduce(|acc, item| if cmp(&acc, &item) { item } else { acc })
} else {
- let null_buffer = array
- .data_ref()
- .null_buffer()
- .map(|b| b.bit_slice(array.offset(), array.len()));
+ let null_buffer = array.data_ref().null_buffer();
Review Comment:
As an added bonus this will be faster. The bug is that BitIndexIterator is
already applying the offset, and so it gets applied twice and we iterate a
somewhat arbitrary part of the null mask.
(Note the way BitIndexIterator is written is that len acts to truncate the
iteration, if len exceeds the data it doesn't panic it just stops early,
perhaps it should)
--
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]