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


##########
parquet-variant-compute/src/variant_array.rs:
##########
@@ -885,13 +937,19 @@ impl StructArrayBuilder {
     }
 
     /// Add an array to this struct array as a field with the specified name.
-    pub fn with_field(mut self, field_name: &str, array: ArrayRef, nullable: 
bool) -> Self {
+    pub fn with_column(mut self, field_name: &str, array: ArrayRef, nullable: 
bool) -> Self {
         let field = Field::new(field_name, array.data_type().clone(), 
nullable);
         self.fields.push(Arc::new(field));
         self.arrays.push(array);
         self
     }
 
+    pub fn with_field(mut self, field: FieldRef, array: ArrayRef) -> Self {
+        self.fields.push(field);
+        self.arrays.push(array);
+        self
+    }
+

Review Comment:
   This is a convenience method, right? 
   
   We already have the datatype (from the array), so maybe we just need pass an 
optional `metadata`?, making this similar to the `Field` constructor? Or, if 
that's too disruptive for exiting callers, `with_column_and_metadata`?



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