Hanyu Zheng created FLINK-32706:
-----------------------------------

             Summary: Add SPLIT(STRING) support in SQL & Table API
                 Key: FLINK-32706
                 URL: https://issues.apache.org/jira/browse/FLINK-32706
             Project: Flink
          Issue Type: Improvement
            Reporter: Hanyu Zheng


SPLIT Function

Description
Splits a string into an array of substrings, based on a delimiter.

Syntax
The syntax for the SPLIT function is:
{code:java}
SPLIT(col1, delimiter){code}
Splits a string into an array of substrings based on a delimiter. If the 
delimiter is not found, then the original string is returned as the only 
element in the array. If the delimiter is empty, then all characters in the 
string are split. If either, string or delimiter, are NULL, then a NULL value 
is returned.

If the delimiter is found at the beginning or end of the string, or there are 
contiguous delimiters, then an empty space is added to the array.

Example
Let's look at some  function examples and explore how to use the SPLIT function.

For example:

 
{code:java}
SELECT SPLIT('abcdefg', 'c');
Result: ['ab', 'defg']

{code}
see also:

ksqldb: 
https://docs.ksqldb.io/en/0.8.1-ksqldb/developer-guide/ksqldb-reference/scalar-functions/#split



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

Reply via email to