Step 3. Stage the Data Files¶
Execute PUT to upload (stage) local data files to an internal stage location.
In this example, you upload data files into the named internal stages you created in Step 2 with automatic data compression enabled by default.
Note
In regular use, you could also stage data files in the default user or table stage. For more information, see Bulk Loading from a Local File System.
CSV¶
Linux or macOS
PUT file:///tmp/load/contacts*.csv @my_csv_stage AUTO_COMPRESS=TRUE;
Windows
PUT file://C:\temp\load\contacts*.csv @my_csv_stage AUTO_COMPRESS=TRUE;
Snowflake returns the following results:
+---------------+------------------+-------------+-------------+--------------------+--------------------+----------+---------+
| source | target | source_size | target_size | source_compression | target_compression | status | message |
|---------------+------------------+-------------+-------------+--------------------+--------------------+----------+---------|
| contacts1.csv | contacts1.csv.gz | 694 | 506 | NONE | GZIP | UPLOADED | |
| contacts2.csv | contacts2.csv.gz | 763 | 565 | NONE | GZIP | UPLOADED | |
| contacts3.csv | contacts3.csv.gz | 771 | 567 | NONE | GZIP | UPLOADED | |
| contacts4.csv | contacts4.csv.gz | 750 | 561 | NONE | GZIP | UPLOADED | |
| contacts5.csv | contacts5.csv.gz | 887 | 621 | NONE | GZIP | UPLOADED | |
+---------------+------------------+-------------+-------------+--------------------+--------------------+----------+---------+
JSON¶
Linux or macOS
PUT file:///tmp/load/contacts.json @my_json_stage AUTO_COMPRESS=TRUE;
Windows
PUT file://C:\temp\load\contacts.json @my_json_stage AUTO_COMPRESS=TRUE;
Snowflake returns the following results:
+---------------+------------------+-------------+-------------+--------------------+--------------------+----------+---------+
| source | target | source_size | target_size | source_compression | target_compression | status | message |
|---------------+------------------+-------------+-------------+--------------------+--------------------+----------+---------|
| contacts.json | contacts.json.gz | 965 | 446 | NONE | GZIP | UPLOADED | |
+---------------+------------------+-------------+-------------+--------------------+--------------------+----------+---------+