Samyak2 commented on code in PR #7914:
URL: https://github.com/apache/arrow-rs/pull/7914#discussion_r2211309113


##########
parquet-variant/src/builder.rs:
##########
@@ -239,12 +279,38 @@ impl ValueBuffer {
             Variant::Binary(v) => self.append_binary(v),
             Variant::String(s) => self.append_string(s),
             Variant::ShortString(s) => self.append_short_string(s),
-            Variant::Object(_) | Variant::List(_) => {
-                unreachable!(
-                    "Nested values are handled specially by ObjectBuilder and 
ListBuilder"
-                );
+            Variant::Object(obj) => {
+                let metadata_field_names = metadata_builder
+                    .field_names
+                    .iter()
+                    .enumerate()
+                    .map(|(i, f)| (f.clone(), i))
+                    .collect::<HashMap<_, _>>();
+
+                let mut object_builder = self.new_object(metadata_builder);
+
+                // first add all object fields that exist in metadata builder

Review Comment:
   +1 for the logical equality function on variants. This will be needed in 
tests where the result and expected variants come from different sources (and 
thus might have a mismatch in metadata or ordering).



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

Reply via email to