xndai commented on code in PR #1169:
URL: https://github.com/apache/iceberg-cpp/pull/1169#discussion_r4724725798


##########
src/iceberg/json_serde.cc:
##########
@@ -1128,16 +1128,16 @@ Result<std::unique_ptr<SnapshotRef>> 
SnapshotRefFromJson(const nlohmann::json& j
 }
 
 Result<std::unique_ptr<Snapshot>> SnapshotFromJson(const nlohmann::json& json) 
{
-  ICEBERG_ASSIGN_OR_RAISE(auto snapshot_id, GetJsonValue<int64_t>(json, 
kSnapshotId));
+  ICEBERG_ASSIGN_OR_RAISE(auto snapshot_id, GetJsonInteger<int64_t>(json, 
kSnapshotId));

Review Comment:
   pls apply the similar fix to other integer fields - last-column-id, 
last-partition-id, default-sort-order-id, current-snapshot-id and 
last-updated-ms. 



##########
src/iceberg/table_metadata.cc:
##########
@@ -321,6 +321,45 @@ Result<std::shared_ptr<Snapshot>> 
TableMetadata::SnapshotById(int64_t snapshot_i
   return *iter;
 }
 
+Status TableMetadata::Validate() const {

Review Comment:
   There are many more invariants check we can be added here. We can do it in a 
separate follow up. Can you please file an issue?



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