aokolnychyi commented on a change in pull request #588: Add sequential number 
prepare for supporting row level delete (WIP)
URL: https://github.com/apache/incubator-iceberg/pull/588#discussion_r350083112
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/util/JsonUtil.java
 ##########
 @@ -70,6 +70,16 @@ public static long getLong(String property, JsonNode node) {
     return pNode.asLong();
   }
 
+  public static Long getLongOrNull(String property, JsonNode node) {
+    if (!node.has(property)) {
+      return null;
+    }
+    JsonNode pNode = node.get(property);
+    Preconditions.checkArgument(pNode != null && !pNode.isNull() && 
pNode.isNumber() && pNode.canConvertToLong(),
+        "Cannot parse %s from non-string value: %s", property, pNode);
 
 Review comment:
   nit: should the error message say "non-string" or "non-numeric"?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to