codephage2020 commented on code in PR #8093: URL: https://github.com/apache/arrow-rs/pull/8093#discussion_r2269874285
########## 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: Oh, I got it. I will add a test for the case. -- 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