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 2019/11/25 10:12:59 UTC

[GitHub] [incubator-iceberg] aokolnychyi commented on a change in pull request #588: Add sequential number prepare for supporting row level delete (WIP)

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:
users@infra.apache.org


With regards,
Apache Git Services

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