yyanyy commented on a change in pull request #2096:
URL: https://github.com/apache/iceberg/pull/2096#discussion_r578066096



##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -451,10 +470,24 @@ public TableMetadata withUUID() {
       return this;
     } else {
       return new TableMetadata(null, formatVersion, 
UUID.randomUUID().toString(), location,
-          lastSequenceNumber, lastUpdatedMillis, lastColumnId, schema, 
defaultSpecId, specs, lastAssignedPartitionId,
-          defaultSortOrderId, sortOrders, properties, currentSnapshotId, 
snapshots, snapshotLog,
-          addPreviousFile(file, lastUpdatedMillis));
+          lastSequenceNumber, lastUpdatedMillis, lastColumnId, 
currentSchemaId, schemas, defaultSpecId, specs,
+          lastAssignedPartitionId, defaultSortOrderId, sortOrders, properties,
+          currentSnapshotId, snapshots, snapshotLog, addPreviousFile(file, 
lastUpdatedMillis));
+    }
+  }
+
+  private int reuseOrCreateNewSchemaId(Schema newSchema) {
+    // if the schema already exists, use its id; otherwise use the highest id 
+ 1
+    int newSchemaId = currentSchemaId;

Review comment:
       In the for loop below it will check if each existing schema's ID is 
greater or equal to this `newSchemaId` and +1 if so, so I think at the end of 
the method it will be currentSchemaId + 1 if no reuse happens? 




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