dino-saurabh commented on code in PR #1169:
URL: https://github.com/apache/iceberg-cpp/pull/1169#discussion_r4711667579


##########
src/iceberg/table_metadata.cc:
##########
@@ -320,6 +320,42 @@ Result<std::shared_ptr<Snapshot>> 
TableMetadata::SnapshotById(int64_t snapshot_i
   return *iter;
 }
 
+Status TableMetadata::ValidateSequenceAndRowIdBounds() const {
+  if (format_version > 1) {
+    ICEBERG_CHECK(last_sequence_number >= kInitialSequenceNumber,
+                  "last-sequence-number cannot be negative: {}", 
last_sequence_number);
+  }
+  if (format_version >= kMinFormatVersionRowLineage) {
+    ICEBERG_CHECK(next_row_id >= kInitialRowId, "next-row-id cannot be 
negative: {}",
+                  next_row_id);
+  }

Review Comment:
   why not add negative check for sequence-number as well?



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