armitage420 commented on code in PR #5550:
URL: https://github.com/apache/hive/pull/5550#discussion_r1861174393
##########
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:
@deniskuzZ `HiveJsonWriter` is used for serializing values to JSON during
`INSERT` statements, so using a single encoding type should suffice. If future
bugs arise (though no such scenarios are currently identified), we can consider
supporting both encoding types as needed.
--
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]