jasperjiaguo commented on code in PR #9114: URL: https://github.com/apache/pinot/pull/9114#discussion_r935808330
########## pinot-common/src/main/java/org/apache/pinot/common/function/scalar/StringFunctions.java: ########## @@ -560,4 +562,42 @@ public static String decodeUrl(String input) throws UnsupportedEncodingException { return URLDecoder.decode(input, StandardCharsets.UTF_8.toString()); } + + /** + * @param input binary data + * @return Base64 encoded String + */ + @ScalarFunction + public static String binaryToBase64(byte[] input) { + return Base64.getEncoder().encodeToString(input); Review Comment: Do we error if the user passes a string to the `toBase64` function, or some implicit type casting will happen? MySQL users might not expect the syntax of `toBase64(toUtf8("hello"))`. Similarly, if the user calls on `fromBase64('')`, they might not expecting us to return hex string. We should at least call this out in the documentation. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org