rdblue commented on a change in pull request #631: Add mechanism to expire old
metadata versions
URL: https://github.com/apache/incubator-iceberg/pull/631#discussion_r346009267
##########
File path:
core/src/main/java/org/apache/iceberg/BaseMetastoreTableOperations.java
##########
@@ -98,8 +98,11 @@ public void commit(TableMetadata base, TableMetadata
metadata) {
LOG.info("Nothing to commit.");
return;
}
+ TableMetadata updated = (base != null && base.file() != null) ?
+ metadata.addPreviousMetadata(base.file().location(),
base.lastUpdatedMillis()) : metadata;
Review comment:
This kind of concern should be handled in the `TableMetadata` update
methods. This is similar to `metadata.rollbackTo`, which not only sets the
current version, but also updates the table history. I think that all of those
methods should add the current object's `file.location()` to the previous
metadata location list, if it is non-null. That way, the caller never needs to
remember to update it.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]