Jackie-Jiang commented on a change in pull request #6458:
URL: https://github.com/apache/incubator-pinot/pull/6458#discussion_r560588208



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/StringFunctions.java
##########
@@ -228,4 +267,88 @@ public static String chr(int codepoint) {
     char[] result = Character.toChars(codepoint);
     return new String(result);
   }
+
+  /**
+   * @see StandardCharsets#UTF_8#encode(String)
+   * @param input
+   * @return bytes
+   */
+  @ScalarFunction
+  public static byte[] toUtf8(String input) {
+    return input.getBytes(StandardCharsets.UTF_8);
+  }
+
+  /**
+   * see Normalizer#normalize(String, Form)
+   * @param input
+   * @return transforms string with NFC normalization form.
+   */
+  @ScalarFunction
+  public static String normalize(String input) {
+    return Normalizer.normalize(input, Normalizer.Form.NFC);
+  }
+
+  /**
+   * see Normalizer#normalize(String, Form)
+   * @param input
+   * @param form
+   * @return transforms string with the specified normalization form
+   */
+  @ScalarFunction
+  public static String normalize(String input, String form) {
+    Normalizer.Form targetForm = Normalizer.Form.valueOf(form);
+    return Normalizer.normalize(input, targetForm);
+  }
+
+  /**
+   * see String#split(String)
+   * @param input
+   * @param delimiter
+   * @return splits string on specified delimiter and returns an array.
+   */
+  @ScalarFunction
+  public static String[] split(String input, String delimiter) {
+    return StringUtils.split(input, delimiter);
+  }
+
+  /**
+   * see String#replaceAll(String, String)
+   * @param input
+   * @param search
+   * @return removes all instances of search from string
+   */
+  @ScalarFunction
+  public static String remove(String input, String search) {
+    return input.replaceAll(search, "");

Review comment:
       ```suggestion
       return StringUtils.remove(input, search);
   ```




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

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