rdblue commented on code in PR #4578:
URL: https://github.com/apache/iceberg/pull/4578#discussion_r863335990


##########
core/src/main/java/org/apache/iceberg/RemoveSnapshots.java:
##########
@@ -195,6 +299,18 @@ public void commit() {
     LOG.info("Committed snapshot changes");
 
     if (cleanExpiredFiles) {
+      TableMetadata updated = ops.refresh();
+      if (updated.refs() != null) {
+        List<SnapshotRef> branches = updated.refs()
+            .values().stream().filter(SnapshotRef::isBranch)
+            .collect(Collectors.toList());
+
+        if (branches.size() > 1) {
+          throw new UnsupportedOperationException(
+              "Deleting expired files when there is more than 1 branch is 
currently not supported");

Review Comment:
   I don't think that this is supported when there are tags either. For 
example, I could have snapshots A, B, C, D and need to expire A and B. If A is 
tagged, then removing B might drop files that are referenced by A. Incremental 
expiration only works if there is only one branch, `main`.



-- 
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: [email protected]

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