You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/07/28 00:27:10 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #9114: Added Base64 Encoding/Decoding Scalar Functions

Jackie-Jiang commented on code in PR #9114:
URL: https://github.com/apache/pinot/pull/9114#discussion_r931681849


##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/StringFunctions.java:
##########
@@ -560,4 +561,24 @@ public static String decodeUrl(String input)
       throws UnsupportedEncodingException {
     return URLDecoder.decode(input, StandardCharsets.UTF_8.toString());
   }
+
+  /**
+   * @param input utf-8 encoded String
+   * @return Base64 encoded String
+   */
+  @ScalarFunction
+  public static String toBase64(String input) {

Review Comment:
   We should decouple the functionality into 2 functions:
   1. encode/decode base64
   2. encode/decode utf8
   
   Currently we are mixing the 2, which is quite confusing, and not as flexible



-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org