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


##########
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,
+            "Cannot add a snapshot, first-row-id is behind table next-row-id: 
%s < %s",
             snapshot.firstRowId(),
             nextRowId);
-        ValidationException.check(
-            snapshot.addedRows() != null,
-            "Cannot add a snapshot with a null 'added-rows' field when row 
lineage is enabled");
-        Preconditions.checkArgument(

Review Comment:
   This is validated in Snapshot now (part of #12593).



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