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


##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -1269,18 +1269,14 @@ public Builder addSnapshot(Snapshot snapshot) {
       snapshotsById.put(snapshot.snapshotId(), snapshot);
       changes.add(new MetadataUpdate.AddSnapshot(snapshot));
 
-      if (rowLineage) {
+      if (formatVersion >= MIN_FORMAT_VERSION_ROW_LINEAGE) {
+        ValidationException.check(
+            snapshot.firstRowId() != null, "Cannot add a snapshot: 
first-row-id is null");
         ValidationException.check(
-            snapshot.firstRowId() >= nextRowId,
-            "Cannot add a snapshot whose 'first-row-id' (%s) is less than the 
metadata 'next-row-id' (%s) because this will end up generating duplicate 
row_ids.",
+            snapshot.firstRowId() != null && snapshot.firstRowId() >= 
nextRowId,

Review Comment:
   nit: I don't think we need the not-null condition here since we just 
validated that it isn't null in the previous validation check



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