danielcweeks commented on code in PR #14509:
URL: https://github.com/apache/iceberg/pull/14509#discussion_r2499802932
##########
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:
I'll update this to just throw. It's more about showing that we can
interrupt the commit than a specific use case (that probably confused things).
--
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]