RussellSpitzer commented on code in PR #15241:
URL: https://github.com/apache/iceberg/pull/15241#discussion_r2774752804


##########
core/src/test/java/org/apache/iceberg/util/TestSnapshotUtil.java:
##########
@@ -248,4 +249,123 @@ public void schemaForTag() {
     assertThat(table.schema().asStruct()).isEqualTo(expected.asStruct());
     assertThat(SnapshotUtil.schemaFor(table, 
tag).asStruct()).isEqualTo(initialSchema.asStruct());
   }
+
+  @Test
+  public void testAddedDataFiles() {
+    DataFile addedFile =
+        DataFiles.builder(SPEC)
+            .withPath("/path/to/test-data.parquet")
+            .withFileSizeInBytes(10)
+            .withRecordCount(1)
+            .build();
+
+    table.newFastAppend().appendFile(addedFile).commit();
+    Snapshot snapshotWithAddedFile = table.currentSnapshot();
+
+    // Test the utility method with table
+    Iterable<DataFile> filesFromTableUtil =
+        SnapshotUtil.addedDataFiles(table, snapshotWithAddedFile);
+    assertThat(filesFromTableUtil).hasSize(1);
+
+    // Test the utility method with explicit parameters
+    Iterable<DataFile> filesFromExplicitParams =
+        SnapshotUtil.addedDataFiles(snapshotWithAddedFile, table.io(), 
table.specs());
+    assertThat(filesFromExplicitParams).hasSize(1);
+
+    // Test using SnapshotFileChanges object directly (for caching)

Review Comment:
   The caching test is below, this is just a test for using the object itself 
SnapshotFileChanges, i'll remove the (for caching) line



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