anoopj commented on code in PR #18795:
URL: https://github.com/apache/iceberg/pull/18795#discussion_r4485939795


##########
core/src/test/java/org/apache/iceberg/TestV4ManifestReader.java:
##########
@@ -663,6 +664,59 @@ public void 
inheritanceFirstRowIdIncrementsByRecordCount(FileFormat format) thro
         .isEqualTo(expected);
   }
 
+  @ParameterizedTest
+  @FieldSource("MANIFEST_FORMATS")
+  public void inheritanceFirstRowIdIsRepeatableAcrossIterations(FileFormat 
format)
+      throws IOException {
+    TrackedFile fileA = dataFile(ADDED_TRACKING, 
"s3://bucket/table/file-a.parquet");
+    TrackedFile fileB = dataFile(ADDED_TRACKING, 
"s3://bucket/table/file-b.parquet");
+
+    ManifestFile manifest =
+        writeManifest(format, UNPARTITIONED_TYPE, ImmutableList.of(fileA, 
fileB));
+    when(manifest.firstRowId()).thenReturn(10_000L);
+
+    V4ManifestReader.Builder builder =
+        V4ManifestReader.builder(manifest, IO, TABLE_SCHEMA, 
ID_PARTITIONING_SPECS)
+            .metricsConfig(METRICS_CONFIG);
+
+    try (V4ManifestReader reader = builder.build()) {
+      assertThat(Lists.newArrayList(reader))
+          .extracting(file -> file.tracking().firstRowId())
+          .containsExactly(10_000L, 10_000L + RECORD_COUNT);
+      assertThat(Lists.newArrayList(reader))
+          .as("a second iteration assigns the same first row IDs")
+          .extracting(file -> file.tracking().firstRowId())
+          .containsExactly(10_000L, 10_000L + RECORD_COUNT);
+    }
+  }
+
+  @ParameterizedTest
+  @FieldSource("MANIFEST_FORMATS")
+  public void inheritanceFirstRowIdIsIndependentBetweenIterators(FileFormat 
format)

Review Comment:
   Fixed. 



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