openinx commented on a change in pull request #2465:
URL: https://github.com/apache/iceberg/pull/2465#discussion_r618143119



##########
File path: core/src/main/java/org/apache/iceberg/SchemaUpdate.java
##########
@@ -59,14 +62,17 @@
   private final Multimap<Integer, Move> moves = 
Multimaps.newListMultimap(Maps.newHashMap(), Lists::newArrayList);
   private int lastColumnId;
   private boolean allowIncompatibleChanges = false;
-
+  private Set<String> identifierNames;
 
   SchemaUpdate(TableOperations ops) {
     this.ops = ops;
     this.base = ops.current();
     this.schema = base.schema();
     this.lastColumnId = base.lastColumnId();
     this.idToParent = 
Maps.newHashMap(TypeUtil.indexParents(schema.asStruct()));
+    this.identifierNames = schema.identifierFieldIds().stream()

Review comment:
       Nit:  It may be unrelated to this PR but I think it's good to reuse this 
two constructor into one so that we could have a simpler version of code: 
   
   ```java
   SchemaUpdate(TableOperations ops) {
       this(ops, ops.current(), ops.current().schema(), 
ops.current().lastColumnId());
     }
   
     /**
      * For testing only.
      */
     SchemaUpdate(Schema schema, int lastColumnId) {
       this(null, null, schema, lastColumnId);
     }
   
     private SchemaUpdate(TableOperations ops, TableMetadata base, Schema 
schema, int lastColumnId) {
       this.ops = ops;
       this.base = base;
       this.schema = schema;
       this.lastColumnId = lastColumnId;
       this.idToParent = 
Maps.newHashMap(TypeUtil.indexParents(schema.asStruct()));
       this.identifierNames = schema.identifierFieldIds().stream()
           .map(id -> schema.findField(id).name())
           .collect(Collectors.toSet());
     }
   ```




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