viirya commented on code in PR #1048:
URL: https://github.com/apache/arrow-rs/pull/1048#discussion_r889491435
##########
arrow/src/compute/kernels/sort.rs:
##########
@@ -151,8 +152,16 @@ fn partition_validity(array: &ArrayRef) -> (Vec<u32>,
Vec<u32>) {
// faster path
0 => ((0..(array.len() as u32)).collect(), vec![]),
_ => {
- let indices = 0..(array.len() as u32);
- indices.partition(|index| array.is_valid(*index as usize))
+ let validity = array.data().null_buffer().unwrap();
Review Comment:
Looks correct to me. This is how `is_valid` implemented internally. Just not
sure if it is good to expose the details here.
`is_valid(i)` is basically:
```rust
let buffer = array.null_buffer().unwrap();
bit_util::get_bit_raw(buffer.as_ptr(), offset + i)
```
--
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]