pgaref commented on a change in pull request #2664:
URL: https://github.com/apache/hive/pull/2664#discussion_r717554831
##########
File path: serde/src/java/org/apache/hadoop/hive/serde2/json/HiveJsonReader.java
##########
@@ -393,7 +402,16 @@ private Object visitLeafNode(final JsonNode leafNode,
case DOUBLE:
return Double.valueOf(leafNode.asDouble());
case STRING:
- return leafNode.asText();
+ if (leafNode.isValueNode()) {
+ return leafNode.asText();
+ } else {
+ if (isEnabled(Feature.STRINGIFY_COMPLEX_FIELDS)) {
+ return leafNode.toString();
+ } else {
+ throw new SerDeException(
+ "Complex field found in JSON does not match table definition: "
+ typeInfo.getTypeName());
Review comment:
Hey @dengzhhu653 not sure what you are referring to here -- this PR is
targeting complex fields with non defined Hive schema (like a map of maps which
is defined as a simple map)
Enabling this feature will cause the JSON reader to treat the above complex
field as a String (the input type is not important here) -- does it make sense?
--
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]