tustvold commented on code in PR #3965:
URL: https://github.com/apache/arrow-rs/pull/3965#discussion_r1150936674


##########
arrow-array/src/array/struct_array.rs:
##########
@@ -216,29 +216,32 @@ impl Array for StructArray {
 
 impl From<Vec<(Field, ArrayRef)>> for StructArray {
     fn from(v: Vec<(Field, ArrayRef)>) -> Self {
-        let (field_types, field_values): (Vec<_>, Vec<_>) = 
v.into_iter().unzip();
-
-        let length = field_values.get(0).map(|a| a.len()).unwrap_or(0);
-        field_types.iter().zip(field_values.iter()).for_each(
-            |(field_type, field_value)| {
-                // Check the length of the child arrays
-                assert_eq!(
-                    length,
-                    field_value.len(),
-                    "all child arrays of a StructArray must have the same 
length"
-                );
-                // Check data types of child arrays
-                assert_eq!(
-                    field_type.data_type(),
-                    field_value.data().data_type(),
-                    "the field data types must match the array data in a 
StructArray"
-                );
-            },
-        );
-
+        let iter = v.into_iter();

Review Comment:
   I hope to rework these once `StructArray::new` exists as part of #3880 



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