You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2019/11/13 21:24:25 UTC

[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #631: Add mechanism to expire old metadata versions

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org