tobixdev opened a new issue, #8947:
URL: https://github.com/apache/arrow-rs/issues/8947
**Describe the bug**
The `take` implementation for `DataType::FixedSizeBinary` does not consider
the nullability of indices. If an index is null, the output value of the kernel
should also be null. This is not the case for fixed size binary arrays.
**To Reproduce**
```rust
#[test]
fn test_take_fixed_size_binary_with_nulls_indices() {
let fsb = FixedSizeBinaryArray::try_from_sparse_iter_with_size(
[
Some(vec![0x01, 0x01, 0x01, 0x01]),
Some(vec![0x02, 0x02, 0x02, 0x02]),
Some(vec![0x03, 0x03, 0x03, 0x03]),
Some(vec![0x04, 0x04, 0x04, 0x04]),
]
.into_iter(),
4,
)
.unwrap();
// The two middle indices are null -> Should be null in the output.
let indices = UInt32Array::from(vec![Some(0), None, None, Some(3)]);
let result = take_fixed_size_binary(&fsb, &indices, 4).unwrap();
assert_eq!(result.len(), 4);
assert_eq!(result.null_count(), 2); // <---- Returns 0
assert_eq!(
result.nulls().unwrap().iter().collect::<Vec<_>>(),
vec![true, false, false, true]
);
}
```
**Expected behavior**
2 Null values in the result
**Additional context**
Surfaced while looking at https://github.com/apache/datafusion/issues/19067
--
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]