Jefffrey commented on code in PR #10813:
URL: https://github.com/apache/arrow-rs/pull/10813#discussion_r3901487807
##########
arrow-select/src/take.rs:
##########
@@ -94,10 +94,10 @@ pub fn take(
let options = options.unwrap_or_default();
downcast_integer_array!(
indices => {
+ let indices = indices.to_indices();
if options.check_bounds {
- check_bounds(values.len(), indices)?;
+ check_bounds(values.len(), &indices)?;
Review Comment:
do we plan to do `take_impl::<_ false>(values, &indices)` here in a followup
PR?
##########
arrow-select/src/take.rs:
##########
@@ -1946,6 +1907,104 @@ mod tests {
);
}
+ #[test]
+ // Null indices + sliced source boolean array — exercises src_offset in
the sparse take_bits path.
+ fn test_take_bool_nullable_index_sliced_source() {
+ let source = BooleanArray::from(vec![Some(true), Some(false),
Some(true), Some(false)]);
+ let source = source.slice(1, 3); // logical: [false, true, false],
offset=1
+ let source = source.as_any().downcast_ref::<BooleanArray>().unwrap();
Review Comment:
```suggestion
let source = source.as_boolean();
```
nit (applicable below too)
--
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]