You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "herunkang2018 (via GitHub)" <gi...@apache.org> on 2023/10/01 13:53:45 UTC

[GitHub] [calcite] herunkang2018 commented on a diff in pull request #3317: [CALCITE-5826] Add FIND_IN_SET function (enabled in Hive and Spark library)

herunkang2018 commented on code in PR #3317:
URL: https://github.com/apache/calcite/pull/3317#discussion_r1342139698


##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -1076,6 +1076,32 @@ public static int levenshtein(String string1, String string2) {
     return LEVENSHTEIN_DISTANCE.apply(string1, string2);
   }
 
+  /** SQL FIND_IN_SET(string, stringArray) function. */
+  public static int findInSet(String matchStr, String textStr) {
+    if (matchStr.contains(",")) {

Review Comment:
   This check is from the function specification, which refered to [Spark's doc](https://spark.apache.org/docs/latest/api/sql/index.html#find_in_set). I will add function annotation to address the meaning of this function.



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

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