RussellSpitzer commented on code in PR #18252:
URL: https://github.com/apache/iceberg/pull/18252#discussion_r4382480987
##########
api/src/main/java/org/apache/iceberg/types/AssignFreshIds.java:
##########
@@ -48,15 +48,31 @@ class AssignFreshIds extends
TypeUtil.CustomOrderSchemaVisitor<Type> {
this.nextId = nextId;
}
- private int idFor(String fullName) {
+ private int idFor(int currentId, Type type) {
+ Types.NestedField existingField = baseField(name(currentId));
+ if (canReuseBaseId(existingField, type)) {
+ return existingField.fieldId();
+ }
+
+ return type.isFileType() ? nextId.get(Types.FileType.NUM_NESTED_FIELDS) :
nextId.get();
Review Comment:
Yep makes sense
--
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]