anoopj commented on code in PR #18795:
URL: https://github.com/apache/iceberg/pull/18795#discussion_r4485935689
##########
core/src/main/java/org/apache/iceberg/V4ManifestReader.java:
##########
@@ -150,20 +145,27 @@ public CloseableIterator<TrackedFile> iterator() {
return CloseableIterable.transform(files, this::copyResolved).iterator();
}
- private TrackedFile applyInheritance(TrackedFile file) {
- // the reader uses TrackingStruct to read tracking so this cast is safe
- TrackingStruct tracking = (TrackingStruct) file.tracking();
- if (isUncommitted) {
- // uncommitted files cannot have a sequence number or assign first row ID
- tracking.inherit(manifest.snapshotId());
- } else {
- tracking.inherit(manifest.snapshotId(), manifest.sequenceNumber());
- if (tracking.assignFirstRowId(nextRowId)) {
- this.nextRowId += file.recordCount();
- }
- }
+ private Function<TrackedFile, TrackedFile> applyInheritance() {
+ return new Function<>() {
+ private Long nextRowId = manifest.firstRowId();
Review Comment:
Thanks. I applied this suggestion. It's easier now that it's split out per
the previous thread.
##########
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)
Review Comment:
Dropped.
--
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]