split_to_array function - Amazon Redshift

Amazon Redshift will no longer support the creation of new Python UDFs starting November 1, 2025. If you would like to use Python UDFs, create the UDFs prior to that date. Existing Python UDFs will continue to function as normal. For more information, see the blog post .

split_to_array function

Uses a delimiter as an optional parameter. If no delimiter is present, then the default is a comma.

Syntax

split_to_array( string,delimiter )

Arguments

string

The input string to be split.

delimiter

An optional value on which the input string will be split. The default is a comma.

Return type

The split_to_array function returns a SUPER data value.

Example

The following example show a split_to_array function.

SELECT SPLIT_TO_ARRAY('12|345|6789', '|'); split_to_array ------------------------- ["12","345","6789"] (1 row)