amogh-jahagirdar commented on code in PR #17764:
URL: https://github.com/apache/iceberg/pull/17764#discussion_r3920887818
##########
core/src/test/java/org/apache/iceberg/TestReplacePartitions.java:
##########
@@ -669,6 +669,42 @@ public void testDeleteReplaceConflict() {
+ "[data_bucket=0]: [/path/to/data-a-deletes.parquet]");
}
+ @TestTemplate
+ public void testConcurrentSuccessiveDVsReplaceConflict() {
+ assumeThat(formatVersion).isGreaterThanOrEqualTo(3);
+
+ commit(table, table.newFastAppend().appendFile(FILE_A), branch);
+
+ TableMetadata base = readMetadata();
+ long baseId = latestSnapshot(base, branch).snapshotId();
+
+ DeleteFile dv1 = newDV(FILE_A);
+ commit(table,
table.newRowDelta().addDeletes(dv1).validateFromSnapshot(baseId), branch);
+
+ long dvSnapshotId = latestSnapshot(readMetadata(), branch).snapshotId();
+
+ DeleteFile dv2 = newDV(FILE_A);
+ commit(
+ table,
+
table.newRowDelta().removeDeletes(dv1).addDeletes(dv2).validateFromSnapshot(dvSnapshotId),
+ branch);
+
+ assertThatThrownBy(
+ () ->
+ commit(
+ table,
+ table
+ .newReplacePartitions()
+ .validateFromSnapshot(baseId)
+ .validateNoConflictingDeletes()
+ .addFile(FILE_A),
+ branch))
+ .isInstanceOf(ValidationException.class)
+ .hasMessageStartingWith(
+ "Found new conflicting delete files that can apply to records
matching [data_bucket=0]")
+ .hasMessageNotContaining("Can't index multiple DVs");
Review Comment:
I'd rather update the message test expectation to just be an exact match
(wherever possible, I know some of these may have exact paths whihc are
annoying, but in those cases, I think the hasMessageStarting with is more than
sufficient to give us confidence). rather than "startingWith" and then
notContaining., it makes it easier to read and verify the test is right.
--
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]