deniskuzZ commented on code in PR #5550:
URL: https://github.com/apache/hive/pull/5550#discussion_r1861188886


##########
serde/src/java/org/apache/hadoop/hive/serde2/json/HiveJsonReader.java:
##########
@@ -466,6 +476,16 @@ private byte[] getByteValue(final JsonNode binaryNode) 
throws SerDeException {
     }
   }
 
+  private BinaryEncoding getBinaryEncodingForNode(JsonNode binaryNode) {
+    String jsonValue = binaryNode.textValue();
+
+    if(jsonValue == null || jsonValue.length() % 4 != 0 || 
!BASE64_PATTERN.matcher(jsonValue).matches()) {
+      return BinaryEncoding.RAWSTRING;
+    }
+
+    return BinaryEncoding.BASE64;

Review Comment:
   so now Hive can read both encodings and write in `HiveJsonWriter` provided 
encoding, is that right?



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

Reply via email to