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


##########
core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java:
##########
@@ -1025,6 +1100,43 @@ private void validateDeleteFilesForVersion(int 
currentFormatVersion) {
     }
   }
 
+  @Override
+  protected NewSnapshotMetadata writeRootManifest(
+      TableMetadata base, Snapshot parent, long sequenceNumber) {
+    validateDeleteFilesForVersion(base.formatVersion());
+
+    if (addsDeleteFiles()) {
+      throw new UnsupportedOperationException("Cannot add new delete files in 
v4");
+    } else if (filterManager.containsDeletes()) {
+      throw new UnsupportedOperationException("Cannot remove data files in 
v4");
+    } else if (deleteFilterManager.containsDeletes()) {
+      throw new UnsupportedOperationException("Cannot remove delete files in 
v4");
+    } else if (!appendManifests.isEmpty()) {

Review Comment:
   I thought that snapshot ID inheritance is allowed because the table version 
is 4. I had originally also added logic so that manifests would be rewritten 
unless they were v4 leaf manifests (since you can't append v1-v3 manifests to a 
v4 table), but I stashed those changes to simplify this PR.
   
   You're right that there's a case here where an old manifest can be appended 
and will be rewritten, then ignored. Since my plan is already to follow up with 
more cases, I think we should fix this by adding support for manifest appends.



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