RussellSpitzer commented on a change in pull request #4303:
URL: https://github.com/apache/iceberg/pull/4303#discussion_r823104635



##########
File path: 
core/src/test/java/org/apache/iceberg/TestOverwriteWithValidation.java
##########
@@ -747,6 +747,60 @@ public void 
testConcurrentConflictingPositionDeletesOverwriteByFilter() {
         overwrite::commit);
   }
 
+  @Test
+  public void testConcurrentConflictingDataFileDeleteOverwriteByFilter() {
+    Assert.assertNull("Should be empty table", table.currentSnapshot());
+
+    table.newAppend()
+        .appendFile(FILE_DAY_1)
+        .appendFile(FILE_DAY_2)
+        .commit();
+
+    Snapshot firstSnapshot = table.currentSnapshot();
+
+    OverwriteFiles overwrite = table.newOverwrite()
+        .overwriteByRowFilter(EXPRESSION_DAY_2)
+        .addFile(FILE_DAY_2_MODIFIED)
+        .validateFromSnapshot(firstSnapshot.snapshotId())
+        .validateNoConflictingData()
+        .validateNoConflictingDeletes();
+
+    table.newOverwrite()
+        .deleteFile(FILE_DAY_2)
+        .commit();
+
+    AssertHelpers.assertThrows("Should reject commit",
+        ValidationException.class, "Found conflicting deleted files",
+        overwrite::commit);
+  }
+
+  @Test
+  public void testConcurrentNonConflictingDataFileDeleteOverwriteByFilter() {
+    Assert.assertNull("Should be empty table", table.currentSnapshot());
+
+    table.newAppend()
+        .appendFile(FILE_DAY_1)
+        .appendFile(FILE_DAY_2)
+        .commit();
+
+    Snapshot firstSnapshot = table.currentSnapshot();
+
+    OverwriteFiles overwrite = table.newOverwrite()

Review comment:
       While this one is alright because file 2 is modified, but file 1 is 
deleted.




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