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 2022/01/20 06:44:59 UTC

[GitHub] [iceberg] amogh-jahagirdar commented on issue #3900: Deprecate TableMetadata.removeSnapshotsIf in favor of metadata builder

amogh-jahagirdar commented on issue #3900:
URL: https://github.com/apache/iceberg/issues/3900#issuecomment-1017167331


   After https://github.com/apache/iceberg/pull/3883 gets closed, I'll raise a PR for this that I have ready. I am planning on deprecating the existing TableMetadata#removeSnapshotsIf and adding the a new removeSnapshots method which simply accepts a set of snapshot ids to remove. It will do validation that the set of snapshot ids passed in does not contain the latest snapshot id. Something like the following.
   
   `  public TableMetadata removeSnapshots(Set<Long> snapshotIdsToRemove) {
       ValidationException.check(!snapshotIdsToRemove.contains(currentSnapshotId),
           String.format("Cannot remove the latest snapshot id: %d", currentSnapshotId));
       return new Builder(this)
           .removeSnapshots(snapshotIdsToRemove)
           .build();
     }`
   


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

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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