sdf-jkl commented on code in PR #8354:
URL: https://github.com/apache/arrow-rs/pull/8354#discussion_r2835611344
##########
parquet-variant-compute/src/variant_get.rs:
##########
@@ -1646,7 +1701,96 @@ mod test {
let expected: ArrayRef = Arc::new(Int32Array::from(vec![Some(1),
Some(42)]));
assert_eq!(&result, &expected);
}
+ /// This test manually constructs a shredded variant array representing
lists
+ /// like ["comedy", "drama"] and ["horror", 123]
+ /// as VariantArray using variant_get.
+ #[test]
+ fn test_shredded_list_index_access() {
+ let array = shredded_list_variant_array();
+ // Test: Extract the 0 index field as VariantArray first
+ let options = GetOptions::new_with_path(VariantPath::from(0));
+ let result = variant_get(&array, options).unwrap();
+ let result_variant = VariantArray::try_new(&result).unwrap();
+ assert_eq!(result_variant.len(), 2);
+ // Row 0: expect 0 index = "comedy"
+ assert_eq!(result_variant.value(0), Variant::from("comedy"));
Review Comment:
https://github.com/apache/arrow-rs/pull/8354/commits/cecd39f8d6020c4569e157c69c30bafbd48dbb62
--
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]