rdblue commented on code in PR #14509:
URL: https://github.com/apache/iceberg/pull/14509#discussion_r2496303708
##########
core/src/test/java/org/apache/iceberg/TestSnapshotProducer.java:
##########
@@ -74,4 +81,105 @@ private void assertManifestWriterCount(
int writerCount = SnapshotProducer.manifestWriterCount(workerPoolSize,
fileCount);
assertThat(writerCount).as(errMsg).isEqualTo(expectedManifestWriterCount);
}
+
+ @TestTemplate
+ public void testCommitValidationPreventingCommit() throws IOException {
+ // Commit the first file
+ table.newAppend().appendFile(FILE_A).commit();
+
+ // Create a file with no records for testing
+ DataFile fileNoRecords =
+ DataFiles.builder(SPEC)
+ .withPath("/path/to/data-no-records.parquet")
+ .withFileSizeInBytes(100)
+ .withRecordCount(0) // File with no records
+ .build();
+
+ // Create a CommitValidator that will reject commits based on snapshot
summary
+ SnapshotUpdateValidator validator =
+ (baseSnapshots, updatedSnapshots) -> {
Review Comment:
Continuing with the argument above, I don't think this test case makes
sense. This is validating the caller's changes during the commit process. If
the caller's changes need to be validated, the caller should do it
independently.
--
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]