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/12/02 17:31:12 UTC

[GitHub] [pinot] walterddr commented on a diff in pull request #9901: [multistage] add tests for string functions

walterddr commented on code in PR #9901:
URL: https://github.com/apache/pinot/pull/9901#discussion_r1038367972


##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/StringFunctions.java:
##########
@@ -97,14 +97,26 @@ public static String substr(String input, int beginIndex) {
    * @param endIndex index at which substring should be terminated
    * @return substring from beginIndex to endIndex
    */
-  @ScalarFunction
+  @ScalarFunction(names = {"substr", "substring"})
   public static String substr(String input, int beginIndex, int endIndex) {
     if (endIndex == -1) {
       return substr(input, beginIndex);
     }
     return StringUtils.substring(input, beginIndex, endIndex);
   }
 
+  /**
+   * Join two input string with seperator in between
+   * @param input1
+   * @param input2
+   * @param seperator
+   * @return The two input strings joined by the seperator
+   */
+  @ScalarFunction(names = "concat_ws")
+  public static String concatws(String seperator, String input1, String input2) {

Review Comment:
   if there's aliasing, then the function name itself also needs to be included ( if we want to say support directly using `concatWs` )



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