nastra commented on code in PR #16586:
URL: https://github.com/apache/iceberg/pull/16586#discussion_r3315784262
##########
core/src/main/java/org/apache/iceberg/util/JsonUtil.java:
##########
@@ -272,7 +272,10 @@ public static String[] getStringArray(JsonNode node) {
ArrayNode arrayNode = (ArrayNode) node;
String[] arr = new String[arrayNode.size()];
for (int i = 0; i < arr.length; i++) {
- arr[i] = arrayNode.get(i).asText();
+ JsonNode element = arrayNode.get(i);
+ Preconditions.checkArgument(
+ element.isTextual(), "Cannot parse string from non-text value: %s",
element);
Review Comment:
too bad we don't have the actual property name here so that we could refer
to the actual field similar to
https://github.com/apache/iceberg/blob/6a54bc1c379d5af78a2dc746fa66c5f0706d0838/core/src/main/java/org/apache/iceberg/util/JsonUtil.java#L473
I wonder if `"Cannot parse string from non-text value in %s: %s", node,
element)` might help here.
--
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]