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/02/04 17:37:57 UTC

[GitHub] [iceberg] jackye1995 commented on a change in pull request #4036: Core: SnapshotRef parser and serialization logic

jackye1995 commented on a change in pull request #4036:
URL: https://github.com/apache/iceberg/pull/4036#discussion_r799676455



##########
File path: core/src/main/java/org/apache/iceberg/util/JsonUtil.java
##########
@@ -65,6 +67,16 @@ public static Integer getIntOrNull(String property, JsonNode node) {
     return pNode.asInt();
   }
 
+  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.isIntegralNumber() &&
+        pNode.canConvertToLong(), "Cannot parse %s from non-string value: %s", property, pNode);

Review comment:
       +1




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