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


##########
core/src/main/java/org/apache/iceberg/TableMetadataParser.java:
##########
@@ -372,6 +373,7 @@ public static TableMetadata fromJson(String 
metadataLocation, JsonNode node) {
           formatVersion == 1, "%s must exist in format v%s", SCHEMAS, 
formatVersion);
 
       schema = SchemaParser.fromJson(JsonUtil.get(SCHEMA, node));
+      Schema.checkCompatibility(schema, formatVersion);

Review Comment:
   I think if this is the case we should have some tests that show that parsing 
invalid metadata is a behavior is allowed by the library. Parsing some invalid 
Json should not throw an exception for compatibility purposes? I think we could 
just take a fully populated V3 Metadata and change it's format version to 1 or 
something. This should be readable (but not really usable)? I'm not sure what 
other cases we would want,  but I think we'd be in a better state if we had 
tests for behaviors we want to keep in the code.



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