Redshift Unload: Amazon Redshift’s Unload Command

 • Updated on 

Redshift’s UNLOAD command is a great little tool that complements Redshift’s COPY command, by doing the exact reverse function. While COPY grabs data from an Amazon s3 bucket and puts into a Redshift table for you, UNLOAD takes the result of a query, and stores the data in Amazon s3.

Why would you want to store the result of a query in s3?

If you ever need your data to be consumed by different applications, or if you want to analyze your data in ways that you can’t do in Redshift (e.g. machine learning), then it makes sense to export it.

How do you use it?

Firstly, you need to determine the data you want to unload into s3. Play around with your SELECT statement until you get it right. Once you have that, here are the basic steps:

UNLOAD(“your select query goes here”) 
TO ‘the full path of your Amazon s3 bucket goes here’ 
AUTHORIZATION (this uses the same authorization template as the [COPY command](https://www.flydata.com/blog/redshift-copy-command/))

What do you need to be aware of when using it?

It’s important to know that max file size of the result sent to s3 can only be 6.2 GB. If your result is larger than that, you’ll either need to trim it down somehow or break it up into multiple SELECTs. More info can be found in AWS’s official documentation.

ETL to Redshift Unlimited sync during trial. No credit card required.
Recent Posts
Google, Facebook, Netflix, LinkedIn, Twitter and all other social media platforms clearly qualify as big data technology centers. But when did they...
 • 
As we proceed through this age of massive information and great technologies, we are obtaining many more angles from which we can record data. As a...
 • 
Looking for the right database technology to use? Luckily there are many database technologies to choose from, including relational databases (MySQ...
 • 
The 5 V’s of Big Data Google, Facebook, Netflix, LinkedIn, Twitter and all other social media platforms clearly qualify as big data technology centers. But when did they...
 • 
What is Big Data? As we proceed through this age of massive information and great technologies, we are obtaining many more angles from which we can record data. As a...
 • 
What's Unique About a Columnar Database? Looking for the right database technology to use? Luckily there are many database technologies to choose from, including relational databases (MySQ...
 • 
Get set up in 30 minutes with automated, continuous, real-time replication Flydata is an authorized Amazon Redshift Partner AWS Marketplace Logo