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


##########
core/src/main/java/org/apache/iceberg/V4ManifestReader.java:
##########
@@ -130,7 +143,16 @@ public CloseableIterator<TrackedFile> iterator() {
   private TrackedFile applyInheritance(TrackedFile file) {
     // the reader uses TrackingStruct to read tracking so this cast is safe
     TrackingStruct tracking = (TrackingStruct) file.tracking();
-    tracking.inherit(manifest.snapshotId(), manifest.sequenceNumber());
+    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)) {

Review Comment:
   This only applies to data files because manifest files only appear in the 
root, and the root is written with explicit first row ID values. This logic 
still works at the root level because none of the first row IDs are null in the 
file.
   
   A related question is whether we want to have different handling for the 
root manifest that validates this rule, but I left that for a different PR. I 
think that we _should_ break `builder` into two more methods, `root` and `leaf` 
that enable extra checks like that.



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