AdamGS opened a new issue, #9701:
URL: https://github.com/apache/arrow-rs/issues/9701
Realized this issue while working on #9610, basically something like the
following test will fail because the null buffer gets dropped without applying
it to the data itself.
```rust
#[test]
fn
test_variant_get_perfectly_shredded_binary_preserves_top_level_nulls() {
let metadata =
BinaryViewArray::from_iter_values(std::iter::repeat_n(EMPTY_VARIANT_METADATA_BYTES,
3));
let typed_value: ArrayRef = Arc::new(BinaryArray::from(vec![
Some(b"Apache" as &[u8]),
Some(b"masked-null" as &[u8]),
Some(b"Parquet-variant" as &[u8]),
]));
let variant_array: ArrayRef = VariantArray::from_parts(
Arc::new(metadata) as _,
None,
Some(typed_value),
Some(NullBuffer::from(vec![true, false, true])),
)
.into();
let result = variant_get(
&variant_array,
GetOptions::new().with_as_type(Some(FieldRef::from(Field::new(
"result",
DataType::Binary,
true,
)))),
)
.unwrap();
let result = result.as_binary::<i32>();
assert_eq!(result.len(), 3);
assert_eq!(result.null_count(), 1); // This will be 0
}
```
--
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]