mikedias commented on code in PR #780:
URL: https://github.com/apache/incubator-xtable/pull/780#discussion_r2659998204
##########
xtable-core/src/test/java/org/apache/xtable/paimon/TestPaimonDataFileExtractor.java:
##########
@@ -147,6 +147,99 @@ void testColumnStatsAreEmpty() {
}
}
+ @Test
+ void testExtractFilesDiffWithNewFiles() {
+ createUnpartitionedTable();
+
+ // Insert initial data
+ testTable.insertRows(5);
+ org.apache.paimon.Snapshot firstSnapshot =
paimonTable.snapshotManager().latestSnapshot();
+ assertNotNull(firstSnapshot);
+
+ // Insert more data to create a second snapshot
+ testTable.insertRows(3);
+ org.apache.paimon.Snapshot secondSnapshot =
paimonTable.snapshotManager().latestSnapshot();
+ assertNotNull(secondSnapshot);
+
+ org.apache.xtable.model.storage.InternalFilesDiff filesDiff =
+ extractor.extractFilesDiff(paimonTable, secondSnapshot, testSchema);
+
+ // Verify we have added files
+ assertNotNull(filesDiff);
+ assertNotNull(filesDiff.getFilesAdded());
+ assertTrue(filesDiff.getFilesAdded().size() > 0);
+
+ // Verify removed files collection exists (size may vary based on
compaction behavior)
+ assertNotNull(filesDiff.getFilesRemoved());
Review Comment:
On this current setup it will always be 1. I've changed to reflect that.
--
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]