Data Sheet
An Overview of
Data Unloading in
Snowflake
Step-By-Step Guide
5201 GREAT AMERICAN PARKWAY, SUITE 320
SANTA CLARA, CA 95054
Tel: (855) 695-8636
E-mail:
[email protected] Website: www.lumendata.com
An Overview of Data Unloading in Snowflake
Snowflake supports data
unloading from a database
table to files. It allows us to
perform bulk unloading as well
as using PARTITION BY.
Snowflake supports unloading
the data into local machines,
internal stages, and external
stages (AWS, AZURE, and
GCP).
It supports downloading the data into a few file formats like CSV, TSV, JSON, and
PARQUET with a UTF-8 file encoding mechanism.
Note: We need a virtual warehouse to unload the data from Snowflake.
Let’s unload the data from the Snowflake table to the local PC by the internal stage
and to the external stage.
Unloading data into local PC by internal stage
We have data in the Snowflake table named “EMPLOYEE_PERSONAL_DETAILS”.
Let’s unload the data in the table to the internal stage named
“SAI_INTERNAL_STAGE”.
01
An Overview of Data Unloading in Snowflake
To unload the data into internal stage, we need to use COPY INTO <LOCATION>
command as shown below:
COPY INTO @SAI_INTERNAL_STAGE FROM EMPLOYEE_PERSONAL_DETAILS
FILE_FORMAT=(TYPE=csv);
list @SAI_INTERNAL_STAGE;
02
An Overview of Data Unloading in Snowflake
Now the file is available in internal stage. To download the file from the internal
stage to the local PC, we need to use the “GET” Command that needs to be run
in CLI using snowsql as shown below:
GET @SAI_INTERNAL_STAGE file://C:\Users\SaiBharadwaja\Desktop\SAI;
The file will get downloaded in the mentioned location as shown in the next
figure.
03
An Overview of Data Unloading in Snowflake
Unload the data into external stage (AWS)
We have data in the Snowflake table named “EMPLOYEE_PERSONAL_DETAILS”.
Let’s unload the data in the table to the external stage named
“SAI_AWS_STAGE”.
04
An Overview of Data Unloading in Snowflake
To unload the data into internal stage, we need to use COPY INTO <LOCATION>
command as shown below.
COPY INTO @SAI_AWS_STAGE FROM EMPLOYEE_PERSONAL_DETAILS
FILE_FORMAT=(TYPE=csv);
LIST @SAI_AWS_STAGE;
05
An Overview of Data Unloading in Snowflake
Now, let’s check whether the file was available in AWS S3 or not.
06
Authors
Sai Bharadwaja
Senior Consultant
About LumenData
LumenData is a leading provider of Enterprise Data Management, Cloud & Analytics
solutions. We help businesses navigate their data visualization and analytics anxieties
and enable them to accelerate their innovation journeys.
Founded in 2008, with locations in multiple countries, LumenData is privileged to serve
over 100 leading companies. LumenData is SOC2 certified and has instituted extensive
controls to protect client data, including adherence to GDPR and CCPA regulations.
Get in touch with us: Let us know what you need:
[email protected] lumendata.com/contact-us