View a markdown version of this page

SPLIT_TO_ARRAY function - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026. We will start enforcing it in phases. For more information on the details of Python end of life and migration options, see the blog post that was published on June 30, 2025.

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 the SPLIT_TO_ARRAY function.

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

See also