zhjwpku commented on code in PR #1162:
URL: https://github.com/apache/iceberg-cpp/pull/1162#discussion_r4679707215


##########
src/iceberg/table_metadata.cc:
##########
@@ -773,7 +773,7 @@ Status 
TableMetadataBuilder::Impl::AssignUUID(std::string_view uuid) {
 
 Status TableMetadataBuilder::Impl::UpgradeFormatVersion(int8_t 
new_format_version) {
   // Check that the new format version is supported
-  if (new_format_version > TableMetadata::kSupportedTableFormatVersion) {

Review Comment:
   do we need to change here?



##########
src/iceberg/json_serde.cc:
##########
@@ -1594,13 +1594,12 @@ Result<std::unique_ptr<TableMetadata>> 
TableMetadataFromJson(const nlohmann::jso
 
   auto table_metadata = std::make_unique<TableMetadata>();
 
-  ICEBERG_ASSIGN_OR_RAISE(table_metadata->format_version,
-                          GetJsonValue<int8_t>(json, kFormatVersion));
-  if (table_metadata->format_version < 1 ||
-      table_metadata->format_version > 
TableMetadata::kSupportedTableFormatVersion) {
-    return JsonParseError("Cannot read unsupported version: {}",
-                          table_metadata->format_version);
+  ICEBERG_ASSIGN_OR_RAISE(auto format_version,
+                          GetJsonInteger<int32_t>(json, kFormatVersion));

Review Comment:
   It's int32_t here, so I think int32_t should be enough for 
IsSupportedFormatVersion too?



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