rdblue commented on code in PR #18248:
URL: https://github.com/apache/iceberg/pull/18248#discussion_r4097633134


##########
core/src/test/java/org/apache/iceberg/TestV4ManifestReader.java:
##########
@@ -370,146 +467,178 @@ public void 
inheritanceUncommittedOnlyInheritsSnapshotId(FileFormat format) thro
             .metricsConfig(METRICS_CONFIG);
     List<TrackedFile> actual = read(builder);
 
+    List<TrackedFile> expected =
+        List.of(
+            unpartitionedDataFile(
+                new TrackingStruct(EntryStatus.ADDED, 1234567L, null, null, 
null, null, null, null),
+                "s3://bucket/table/file-b.parquet"),
+            unpartitionedDataFile( // inherits only snapshot ID
+                new TrackingStruct(EntryStatus.ADDED, 34L, null, null, null, 
null, null, null),
+                "s3://bucket/table/file-a.parquet"));
+
     assertThat(actual)
-        .extracting(file -> file.tracking().snapshotId())
-        .containsExactly(1234567L, SNAPSHOT_ID);
-    assertThat(actual)
-        .as("Uncommitted files do not inherit data sequence number")
-        .extracting(file -> file.tracking().dataSequenceNumber())
-        .containsOnlyNulls();
-    assertThat(actual)
-        .as("Uncommitted files do not inherit file sequence number")
-        .extracting(file -> file.tracking().fileSequenceNumber())
-        .containsOnlyNulls();
+        .usingComparatorForType(FILE_AND_TRACKING_COMPARATOR, 
TrackedFile.class)
+        .isEqualTo(expected);
   }
 
   @ParameterizedTest
   @FieldSource("MANIFEST_FORMATS")
   public void inheritanceSnapshotId(FileFormat format) throws IOException {
-    Tracking trackingWithSnapshotId =
-        new TrackingStruct(EntryStatus.ADDED, 1234567L, null, null, null, 
null, null, null);
     TrackedFile withSnapshotId =
-        unpartitionedDataFile(trackingWithSnapshotId, 
"s3://bucket/table/file-b.parquet");
-    Tracking trackingWithoutSnapshotId =
-        new TrackingStruct(EntryStatus.ADDED, null, null, null, null, null, 
null, null);
+        unpartitionedDataFile(
+            new TrackingStruct(EntryStatus.ADDED, 1234567L, 5L, 5L, null, 
5_000L, null, null),
+            "s3://bucket/table/file-b.parquet");
     TrackedFile withoutSnapshotId =
-        unpartitionedDataFile(trackingWithoutSnapshotId, 
"s3://bucket/table/file-a.parquet");
+        unpartitionedDataFile(
+            new TrackingStruct(EntryStatus.ADDED, null, 5L, 5L, null, 5_100L, 
null, null),

Review Comment:
   Existing tests were updated to use constants rather than null values to 
isolate specific inheritance cases.



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