kbendick commented on code in PR #5438:
URL: https://github.com/apache/iceberg/pull/5438#discussion_r938075675


##########
core/src/main/java/org/apache/iceberg/MetadataUpdateParser.java:
##########
@@ -383,7 +383,7 @@ private static MetadataUpdate 
readUpgradeFormatVersion(JsonNode node) {
 
   private static MetadataUpdate readAddSchema(JsonNode node) {
     Preconditions.checkArgument(node.hasNonNull(SCHEMA), "Cannot parse missing 
field: schema");
-    JsonNode schemaNode = node.get(SCHEMA);
+    JsonNode schemaNode = JsonUtil.get(SCHEMA, node);

Review Comment:
   Consider relying on the `Precondition` inside of `JsonUtil` (and have it use 
`hasNonNull`). That pattern seems to exist a lot still and could be pushed into 
`JsonUtil`.



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