uros-b commented on code in PR #17359:
URL: https://github.com/apache/iceberg/pull/17359#discussion_r3652245576


##########
core/src/main/java/org/apache/iceberg/BaseRewriteFiles.java:
##########
@@ -152,5 +152,12 @@ private void validateReplacedAndAddedFiles() {
     Preconditions.checkArgument(
         deletesDeleteFiles() || !addsDeleteFiles(),
         "Delete files to add must be empty because there's no delete file to 
be rewritten");
+
+    for (DataFile added : addedDataFiles()) {
+      Preconditions.checkArgument(
+          !replacedDataFiles.contains(added),
+          "Cannot add and delete the same file in the same rewrite: %s",
+          added.location());
+    }

Review Comment:
   CI doesn't look good at this time, @amogh-jahagirdar PTAL - this PR should 
probably either update every affected test to a different REPLACE-snapshot 
mechanism or scope the fix differently



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