You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/08/16 19:18:39 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #5526: Core: Add some tests for JsonUtil & reduce duplicated code

rdblue commented on code in PR #5526:
URL: https://github.com/apache/iceberg/pull/5526#discussion_r947169528


##########
core/src/main/java/org/apache/iceberg/util/JsonUtil.java:
##########
@@ -105,11 +105,11 @@ public static JsonNode get(String property, JsonNode node) {
   }
 
   public static int getInt(String property, JsonNode node) {
-    Preconditions.checkArgument(node.has(property), "Cannot parse missing int %s", property);
+    Preconditions.checkArgument(node.has(property), "Cannot parse missing int: %s", property);
     JsonNode pNode = node.get(property);
     Preconditions.checkArgument(
-        pNode != null && !pNode.isNull() && pNode.isNumber(),
-        "Cannot parse %s to an integer value: %s",
+        pNode != null && !pNode.isNull() && pNode.isIntegralNumber() && pNode.canConvertToInt(),
+        "Cannot parse to an integer value: %s: %s",

Review Comment:
   I think the double `:` is good.



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org