timothyw553 commented on code in PR #19266:
URL: https://github.com/apache/iceberg/pull/19266#discussion_r4794851592


##########
core/src/test/java/org/apache/iceberg/TestFilePlanner.java:
##########
@@ -164,6 +165,34 @@ void rootWithMixedDataAndLeafManifests(FileFormat format) 
throws IOException {
         .containsExactlyInAnyOrder(FILE_A, FILE_C, FILE_D);
   }
 
+  @ParameterizedTest
+  @FieldSource("MANIFEST_FORMATS")
+  void rootWithExistingLeafManifest(FileFormat format) throws IOException {
+    ManifestFile leaf =
+        writeManifest(format, EMPTY_PARTITION, 
ImmutableList.of(unpartitionedDataFile(FILE_A)));
+    Tracking existing =
+        new TrackingStruct(
+            EntryStatus.EXISTING,
+            SNAPSHOT_ID,
+            SEQUENCE_NUMBER,
+            SEQUENCE_NUMBER,
+            null, // modifiedSnapshotId
+            null, // firstRowId
+            null, // deletedPositions
+            null, // replacedPositions
+            SNAPSHOT_TIMESTAMP_MICROS);
+    ManifestFile root =
+        writeManifest(
+            format,
+            EMPTY_PARTITION,
+            ImmutableList.of(
+                manifestRefWithTracking(existing, FileContent.DATA_MANIFEST, 
leaf.path())));
+
+    List<FileScanTask> tasks = plan(root, UNPARTITIONED_SPECS);
+
+    
assertThat(Iterables.getOnlyElement(tasks).file().location()).isEqualTo(FILE_A);

Review Comment:
   this checks an `EXISTING` leaf manifest reference, and only asserts the file 
location. could we also add a test with an `EXISTING` data file stored directly 
in the root whose timestamp differs from the root snapshot's time, and assert 
it keeps its stored timestamp?



##########
core/src/test/java/org/apache/iceberg/TestV4ManifestReader.java:
##########
@@ -2162,6 +2226,7 @@ private static ManifestFile v4Manifest(String path) {
     when(manifest.content()).thenReturn(ManifestContent.DATA);
     when(manifest.snapshotId()).thenReturn(SNAPSHOT_ID);
     when(manifest.sequenceNumber()).thenReturn(MANIFEST_SEQ);
+    when(manifest.snapshotTimestampMicros()).thenReturn(MANIFEST_SNAPSHOT_TS);

Review Comment:
   since the shared helper sets `MANIFEST_SNAPSHOT_TS`, neither 
uncommitted-reader test exercises a null manifest timestamp. could we override 
it to null in `inheritanceUncommittedSkipsFirstRowId` so both cases are covered?
   
   ```diff
   @@ inheritanceUncommittedSkipsFirstRowId
        when(manifest.firstRowId()).thenReturn(10_000L);
   +    when(manifest.snapshotTimestampMicros()).thenReturn(null);
   ```



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