kbendick commented on code in PR #4578:
URL: https://github.com/apache/iceberg/pull/4578#discussion_r863009565
##########
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:
Should this throw after doing all of the work (e.g. the commit etc)?
If I understand correctly, throwing here will cause the actual remove
snapshots query / action to "fail" from the POV of the end user.
If that's the case, i think we should log an error and then proceed given
that we've already committed the snapshot changes, or check this earlier on and
then throw if need be.
--
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]