You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/07/21 10:13:00 UTC

[jira] [Updated] (FLINK-26940) Add SUBSTRING_INDEX supported in SQL & Table API

     [ https://issues.apache.org/jira/browse/FLINK-26940?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated FLINK-26940:
-----------------------------------
    Labels: pull-request-available  (was: )

> Add SUBSTRING_INDEX supported in SQL & Table API
> ------------------------------------------------
>
>                 Key: FLINK-26940
>                 URL: https://issues.apache.org/jira/browse/FLINK-26940
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table SQL / API
>            Reporter: dalongliu
>            Priority: Major
>              Labels: pull-request-available
>
> Returns the substring of {{expr}} before {{count}} occurrences of the delimiter {{{}delim{}}}.
> Syntax:
> {code:java}
> substring_index(expr, delim, count){code}
> Arguments:
>  * {{{}expr{}}}: A STRING or BINARY expression.
>  * {{{}delim{}}}: An expression matching the type of {{expr}} specifying the delimiter.
>  * {{{}count{}}}: An INTEGER expression to count the delimiters.
> Returns:
> The result matches the type of {{{}expr{}}}.
> 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.
> Examples:
> {code:java}
> > SELECT substring_index('www.apache.org', '.', 2);
>  www.apache {code}
> See more:
>  * [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf]
>  * [Databricks SQL |https://docs.databricks.com/spark/latest/spark-sql/language-manual/functions/substring_index.html]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)