RussellSpitzer commented on code in PR #11948:
URL: https://github.com/apache/iceberg/pull/11948#discussion_r1913745405


##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -1230,6 +1260,18 @@ public Builder addSnapshot(Snapshot snapshot) {
       snapshotsById.put(snapshot.snapshotId(), snapshot);
       changes.add(new MetadataUpdate.AddSnapshot(snapshot));
 
+      if (rowLineage) {
+        ValidationException.check(
+            snapshot.firstRowId() >= lastRowId,
+            "Cannot add a snapshot whose first-row-id (%s) is less than the 
metadata `last-used-id` (%s) because this will end up generating duplicate 
row_ids.",
+            snapshot.firstRowId(),
+            lastRowId);
+        ValidationException.check(
+            snapshot.addedRows() != null,
+            "Cannot add a snapshot with a null `addedRows` field when row 
lineage is enabled");
+        this.incrementLastRowId(snapshot.addedRows());

Review Comment:
   i think we have inconsistent style around this. Sometimes in the file we use 
this.$accessor and other times just $accessor



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to