rdblue commented on a change in pull request #1335:
URL: https://github.com/apache/iceberg/pull/1335#discussion_r470917509



##########
File path: 
parquet/src/main/java/org/apache/iceberg/parquet/MessageTypeToType.java
##########
@@ -56,36 +60,38 @@
 
   @Override
   public Type message(MessageType message, List<Type> fields) {
-    return struct(message, fields);
+    Type struct = struct(message, fields);
+    return struct != null ? struct : Types.StructType.of(Lists.newArrayList());
   }
 
   @Override
   public Type struct(GroupType struct, List<Type> fieldTypes) {
-    if (struct == root) {
-      nextId = 1; // use the reserved IDs for the root struct
-    }
-
     List<org.apache.parquet.schema.Type> parquetFields = struct.getFields();
-    List<Types.NestedField> fields = 
Lists.newArrayListWithExpectedSize(fieldTypes.size());
+    List<Types.NestedField> fields = Lists.newArrayList();

Review comment:
       I think it would be fine to continue to use `withExpectedSize` because 
the size will actually be smaller.




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to