alamb commented on code in PR #2780:
URL: https://github.com/apache/arrow-rs/pull/2780#discussion_r980260831
##########
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:
Is there any other kernel that might have the same issue?
There appear to be a few other similar uses:
https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/apache/arrow-rs%24+bit_slice&patternType=standard
##########
arrow/src/compute/kernels/aggregate.rs:
##########
@@ -1130,4 +1128,22 @@ mod tests {
let array = dict_array.downcast_dict::<Float32Array>().unwrap();
assert_eq!(2.0_f32, min_array::<Float32Type, _>(array).unwrap());
}
+
+ #[test]
+ fn test_min_max_sliced() {
Review Comment:
I suggest some coverage for `max` as well.
Also, shall we try the min/max for `utf8` and `boolean`?
--
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]