alamb commented on code in PR #8093: URL: https://github.com/apache/arrow-rs/pull/8093#discussion_r2267990346
########## 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: Are we sure that this case (where there is a `value` field present, but it is all null) should be treated as though there was no `value` field? I haven't double checked the spec (probably the Arrow one) but this feels like it may be out of compliance -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org