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

[GitHub] [calcite] hujianhong commented on a diff in pull request #3292: [CALCITE-5807] Add SUBSTRING_INDEX function (enabled in Spark library)

hujianhong commented on code in PR #3292:
URL: https://github.com/apache/calcite/pull/3292#discussion_r1301658300


##########
site/_docs/reference.md:
##########
@@ -2764,6 +2764,7 @@ BigQuery's type system uses confusingly different names for types and functions:
 | s | MAP_FROM_ARRAYS(array1, array2)                | Returns a map created from an *array1* and *array2*. Note that the lengths of two arrays should be the same and calcite is using the LAST_WIN strategy
 | s | MAP_FROM_ENTRIES(arrayOfRows)                  | Returns a map created from an arrays of row with two fields. Note that the number of fields in a row must be 2. Note that calcite is using the LAST_WIN strategy
 | s | STR_TO_MAP(string [, stringDelimiter [, keyValueDelimiter]]) | Returns a map after splitting the *string* into key/value pairs using delimiters. Default delimiters are ',' for *stringDelimiter* and ':' for *keyValueDelimiter*. Note that calcite is using the LAST_WIN strategy
+| s | SUBSTRING_INDEX(string, delim, count)          | Returns the substring from **string** before **count** occurrences of the delimiter **delim**. If **count** is positive, everything to the left of the final delimiter (counting from the left) is returned. If **count** is negative, everything to the right of the final delimiter (counting from the right) is returned. The function substring_index performs a case-sensitive match when searching for **delim**.

Review Comment:
   Just referred from spark docucment: https://spark.apache.org/docs/latest/api/sql/index.html#substring_index.
   
   I will fix it.



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