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


##########
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:
   Thank you so for the review! 
   Dropped this variable from HiveJsonReader as here we are detecting the 
encoding automatically. Although, HiveJsonWriter will use BASE64 encoding to 
serialized data for insert statements.



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