nastra commented on code in PR #5526:
URL: https://github.com/apache/iceberg/pull/5526#discussion_r946408489
##########
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:
that's why I proposed using single quotes in
https://github.com/apache/iceberg/pull/5434 because readability suffers a
little bit with double `:`
I'm not sure readability is much better with (%s, %s) but in the JSON parser
case I think double `:` make sense, since they denote `propertyName: value`
when stuff fails
--
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]