stevenzwu commented on code in PR #16689:
URL: https://github.com/apache/iceberg/pull/16689#discussion_r3376714671


##########
core/src/main/java/org/apache/iceberg/TrackingBuilder.java:
##########
@@ -143,6 +145,17 @@ Tracking build() {
         replacedPositions);
   }
 
+  /**
+   * Promotes an EXISTING entry to MODIFIED on mutation. Fresh-add builders 
(status = ADDED) are
+   * preserved — covers the same-commit append + DV attach case without a 
special branch.
+   */
+  private void promoteToModified() {
+    if (status == EntryStatus.EXISTING) {
+      this.status = EntryStatus.MODIFIED;
+      this.snapshotId = newSnapshotId;

Review Comment:
   good catch. 
   
   We also discussed offline that  the `deletePositions` and 
`replacedPositions` should also advance the `dvSnapshotId` to the 
`newSnapshotId`. both are only used for leaf manifest entries in the root 
manifest file.
   
   We are unlikely to compute and set them for data file entries in the root or 
leaf manifest files. Since data DVs are stored in external Puffin files, it is 
too expensive to compute and store the delta `deletedPositions`. 
   
   In the future, when column files metadata are added, we will have new 
transition/mutation APIs and new `latestColumnFileSnapshotId`.



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