nastra commented on code in PR #12520:
URL: https://github.com/apache/iceberg/pull/12520#discussion_r1995254460


##########
api/src/main/java/org/apache/iceberg/types/AssignFreshIds.java:
##########
@@ -88,11 +88,16 @@ public Type struct(Types.StructType struct, Iterable<Type> 
futures) {
     for (int i = 0; i < length; i += 1) {
       Types.NestedField field = fields.get(i);
       Type type = types.next();
-      if (field.isOptional()) {
-        newFields.add(Types.NestedField.optional(newIds.get(i), field.name(), 
type, field.doc()));
-      } else {
-        newFields.add(Types.NestedField.required(newIds.get(i), field.name(), 
type, field.doc()));
-      }
+      newFields.add(

Review Comment:
   can you please add some tests to `TestTypeUtil` that use 
`TypeUtil.assignFreshIds()`and verify that the defaults are properly propagated?
   We might also have the same issue with `TypeUtil.reassignDocs()`, so I think 
it would be good to add some tests for that as well



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