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


##########
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(),

Review Comment:
   👍 good catch.



##########
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:
   Nit: The usage of double `:` here is a bit odd to me.
   
   Maybe `Cannot parse integer value for property: (%s, %s)`?



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