View a markdown version of this page

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.

ARRAY function

Creates an array of the SUPER data type.

Syntax

ARRAY( [ expr1 ] [, expr2 [, ... ]] )

Argument

expr1, expr2

Expressions of any Amazon Redshift data type except date and time types, since Amazon Redshift doesn't cast the date and time types to the SUPER data type. The arguments don't need to be of the same data type.

Return type

The ARRAY function returns the SUPER data type.

Example

The following examples show an array of numeric values and an array of different data types.

--an array of numeric values select ARRAY(1,50,null,100); array ------------------ [1,50,null,100] (1 row) --an array of different data types select ARRAY(1,'abc',true,3.14); array ----------------------- [1,"abc",true,3.14] (1 row)

See also