westonpace opened a new issue, #5169:
URL: https://github.com/apache/arrow-rs/issues/5169
**Describe the bug**
When running `arrow_select::take::take` on a `FixedSizeListArray` and
passing in indices that contain null then there is a panic:
```
thread 'take::tests::test_take_fixed_list_null_indices' panicked at
arrow-data/src/data.rs:533:9:
assertion failed: (offset + length) <= self.len()
```
**To Reproduce**
```
#[test]
fn test_take_fixed_list_null_indices() {
let indices = Int32Array::new(vec![0, 1].into(),
Some(NullBuffer::from(vec![true, false])));
let values = Arc::new(Int32Array::from(vec![0, 1, 2, 3]));
let arr_field = Arc::new(Field::new("item",
values.data_type().clone(), true));
let values = FixedSizeListArray::try_new(arr_field, 2, values,
None).unwrap();
let r = take(&values, &indices, None).unwrap();
let values = r
.as_fixed_size_list()
.values()
.as_primitive::<Int32Type>()
.into_iter()
.collect::<Vec<_>>();
assert_eq!(&values, &[Some(0), Some(1), None, None])
}
```
**Expected behavior**
There is no panic and the take operation returns what is expected.
**Additional context**
I encountered this issue running full outer joins in datafusion on batches
that have fixed size list arrays in the payloads. The outer join
implementation appears to materialize nulls (when one side doesn't match) by
using take with null indices.
--
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]