scovich commented on code in PR #9963:
URL: https://github.com/apache/arrow-rs/pull/9963#discussion_r3248886545


##########
parquet-variant-compute/src/variant_array_builder.rs:
##########
@@ -145,7 +161,11 @@ impl VariantArrayBuilder {
         );
         // TODO add arrow extension type metadata
 
-        VariantArray::try_new(&inner).expect("valid VariantArray by 
construction")
+        let unshredded = VariantArray::try_new(&inner).expect("valid 
VariantArray by construction");
+        match shredding_schema {
+            Some(as_type) => shred_variant(&unshredded, 
&as_type).expect("shred_variant failed"),

Review Comment:
   Please no panics in prod code like this. Do we know what could go wrong? 
Does `build` need to return `Result` so we can surface the error properly?
   
   (I expect that the schema could be invalid, for example, which is 
technically a user error but an easy one to make if you don't fully understand 
the intricacies of variant shredding)



-- 
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]

Reply via email to