You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "nastra (via GitHub)" <gi...@apache.org> on 2023/05/04 06:58:36 UTC

[GitHub] [iceberg] nastra commented on a diff in pull request #6934: core: add JSON parser for ContentFile and FileScanTask

nastra commented on code in PR #6934:
URL: https://github.com/apache/iceberg/pull/6934#discussion_r1184613105


##########
core/src/main/java/org/apache/iceberg/util/JsonUtil.java:
##########
@@ -173,6 +176,18 @@ public static String getStringOrNull(String property, JsonNode node) {
     return getString(property, node);
   }
 
+  public static ByteBuffer getByteBufferOrNull(String property, JsonNode node) {
+    if (!node.has(property) || node.get(property).isNull()) {
+      return null;
+    }
+
+    JsonNode pNode = node.get(property);
+    Preconditions.checkArgument(
+        pNode.isTextual(), "Cannot parse from non-text value: %s: %s", property, pNode);

Review Comment:
   nit: maybe we should mention that we're trying to parse this from text to a binary representation



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