SPLIT

functionsupportedCore SQL functions

docs.snowflake.com ↗

String & binary functions

Splits a given string with a given separator and returns the result in an array of strings. Contiguous split strings in the source string, or the presence of a split string at the beginning or end of the source string, results in an empty string in the output. An empty separator string results in an array containing only the source string. If either parameter is a NULL, a NULL is returned. You can use functions and constructs that operate on arrays on the result, such as FLATTEN, ARRAY_SIZE, and access by index position. See also: SPLIT_PART

Syntax

SPLIT(<string>, <separator>)

Parameters

NameRequiredDescription
stringrequiredText to be split into parts.
separatorrequiredText to split string by.

Returns

The data type of the returned value is ARRAY.

Collation details

This function doesn’t support the following collation specifications: - pi (punctuation-insensitive). - cs-ai (case-sensitive, accent-insensitive). The values in the output array don’t include a collation specification and therefore don’t support further collation operations.

Referenced by