codephage2020 commented on code in PR #8093:
URL: https://github.com/apache/arrow-rs/pull/8093#discussion_r2270096080
##########
parquet-variant-compute/src/variant_array.rs:
##########
@@ -488,4 +495,50 @@ mod test {
fn make_binary_array() -> ArrayRef {
Arc::new(BinaryArray::from(vec![b"test" as &[u8]]))
}
+
+ #[test]
+ fn all_null_shredding_state() {
+ let metadata = BinaryViewArray::from(vec![b"test" as &[u8]]);
+ let shredding_state = ShreddingState::try_new(metadata.clone(), None,
None).unwrap();
+
+ assert!(matches!(shredding_state, ShreddingState::AllNull { .. }));
+
+ // Verify metadata is preserved correctly
+ if let ShreddingState::AllNull { metadata: m } = shredding_state {
+ assert_eq!(m.len(), metadata.len());
+ assert_eq!(m.value(0), metadata.value(0));
+ }
+ }
+
+ #[test]
+ fn all_null_variant_array_construction() {
+ let metadata = BinaryViewArray::from(vec![b"test" as &[u8]; 3]);
+ let nulls = NullBuffer::from(vec![false, false, false]); // all null
Review Comment:
I added a comprehensive test that demonstrates when a value field exists in
the schema but contains all null values, it correctly remains in the
Unshredded state rather than AllNull.
--
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]