Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Unloading semistructured data

Focus mode
Unloading semistructured data - Amazon Redshift

With Amazon Redshift, you can export semistructured data from your Amazon Redshift cluster to Amazon S3 in a variety of formats, including text, Apache Parquet, Apache ORC, and Avro. The following sections will guide you through the process of configuring and executing unload operations for your semistructured data in Amazon Redshift.

CSV or text formats

You can unload tables with SUPER data columns to Amazon S3 in a comma-separated value (CSV) or text format. Using a combination of navigation and unnest clauses, Amazon Redshift unloads hierarchical data in SUPER data format to Amazon S3 in CSV or text formats. Subsequently, you can create external tables against unloaded data and query them using Redshift Spectrum. For information on using UNLOAD and the required IAM permissions, see UNLOAD.

Before running the following example, populate the region_nations table using the processes in Loading semistructured data into Amazon Redshift. For information on the tables used in the following example, see SUPER sample dataset.

The following example unloads data into Amazon S3.

UNLOAD ('SELECT * FROM region_nations') TO 's3://xxxxxx/' IAM_ROLE 'arn:aws:iam::xxxxxxxxxxxx:role/Redshift-S3-Write' DELIMITER AS '|' GZIP ALLOWOVERWRITE;

Unlike other data types where a user-defined string represents a null value, Amazon Redshift exports the SUPER data columns using the JSON format and represents it as null as determined by the JSON format. As a result, SUPER data columns ignore the NULL [AS] option used in UNLOAD commands.

Parquet format

You can unload tables with SUPER data columns to Amazon S3 in the Parquet format. Amazon Redshift represents SUPER columns in Parquet as the JSON data type. This enables semistructured data to be represented in Parquet. You can query these columns using Redshift Spectrum or ingest them back to Amazon Redshift using the COPY command. For information on using UNLOAD and the required IAM permissions, see UNLOAD.

The following example unloads data into Amazon S3 in the Parquet format.

UNLOAD ('SELECT * FROM region_nations') TO 's3://xxxxxx/' IAM_ROLE 'arn:aws:iam::xxxxxxxxxxxx:role/Redshift-S3-Write' FORMAT PARQUET;

You can unload tables with SUPER data columns to Amazon S3 in a comma-separated value (CSV) or text format. Using a combination of navigation and unnest clauses, Amazon Redshift unloads hierarchical data in SUPER data format to Amazon S3 in CSV or text formats. Subsequently, you can create external tables against unloaded data and query them using Redshift Spectrum. For information on using UNLOAD and the required IAM permissions, see UNLOAD.

Before running the following example, populate the region_nations table using the processes in Loading semistructured data into Amazon Redshift. For information on the tables used in the following example, see SUPER sample dataset.

The following example unloads data into Amazon S3.

UNLOAD ('SELECT * FROM region_nations') TO 's3://xxxxxx/' IAM_ROLE 'arn:aws:iam::xxxxxxxxxxxx:role/Redshift-S3-Write' DELIMITER AS '|' GZIP ALLOWOVERWRITE;

Unlike other data types where a user-defined string represents a null value, Amazon Redshift exports the SUPER data columns using the JSON format and represents it as null as determined by the JSON format. As a result, SUPER data columns ignore the NULL [AS] option used in UNLOAD commands.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.