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



##########
File path: 
parquet/src/main/java/org/apache/iceberg/parquet/ApplyNameMapping.java
##########
@@ -67,11 +67,18 @@ public Type list(GroupType list, Type elementType) {
     Preconditions.checkArgument(elementType != null,
         "List type must have element field");
 
+    Type repeatedType = list.getFields().get(0);
+    boolean isOldListElementType = 
ParquetSchemaUtil.isOldListElementType(repeatedType, list.getName());
     MappedField field = nameMapping.find(currentPath());
-    Type listType = Types.buildGroup(list.getRepetition())
-        .as(LogicalTypeAnnotation.listType())
-        .repeatedGroup().addFields(elementType).named(list.getFieldName(0))
-        .named(list.getName());
+
+    Types.GroupBuilder<GroupType> listBuilder = 
Types.buildGroup(list.getRepetition())
+        .as(LogicalTypeAnnotation.listType());
+    if (isOldListElementType) {
+      listBuilder.addFields(elementType);

Review comment:
       I think that this handling is correct for `elementType` when it was a 
2-level list.




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



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

Reply via email to