rdblue commented on a change in pull request #2096:
URL: https://github.com/apache/iceberg/pull/2096#discussion_r575716962
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -463,14 +496,30 @@ public TableMetadata updateSchema(Schema newSchema, int
newLastColumnId) {
// rebuild all of the partition specs and sort orders for the new current
schema
List<PartitionSpec> updatedSpecs = Lists.transform(specs, spec ->
updateSpecSchema(newSchema, spec));
List<SortOrder> updatedSortOrders = Lists.transform(sortOrders, order ->
updateSortOrderSchema(newSchema, order));
+
+ int newSchemaId = reuseOrCreateNewSchemaId(newSchema);
+ if (currentSchemaId == newSchemaId && newLastColumnId == lastColumnId) {
+ // the new spec and last column Id is already current and no change is
needed
+ return this;
+ }
+
+ ImmutableList.Builder<Schema> builder = ImmutableList.<Schema>builder()
+ .addAll(schemas);
Review comment:
Can this be on the previous line?
----------------------------------------------------------------
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]