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:
wait, why do we need to determine the encoding if we could simply pass the
encoding used in the writer as it was done originally?
first check if `binaryEncoding` was provided, if not - try to detect
--
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]