Step 3. Stage the Data Files¶
Execute PUT to upload (stage) sample data files from your local file system to the stages you created in Step 2. Create Stage Objects.
Staging the CSV Sample Data Files¶
Execute the PUT command to upload the CSV files from your local file system.
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;
Let us take a closer look at the command:
file://<file-path>[/\]contacts*.csv
specifies the full directory path and names of the files on your local machine to stage. Note that file system wildcards are allowed.@my_csv_stage
is the stage name where to stage the data.auto_compress=true;
directs the command to compress the data when staging. This is also the default.
The command returns the following result, showing the staged files:
+---------------+------------------+-------------+-------------+--------------------+--------------------+----------+---------+
| 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 | |
+---------------+------------------+-------------+-------------+--------------------+--------------------+----------+---------+
Staging the JSON Sample Data Files¶
Execute the PUT command to upload the JSON file from your local file system to the named stage.
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;
The command returns the following result, showing the staged files:
+---------------+------------------+-------------+-------------+--------------------+--------------------+----------+---------+
| source | target | source_size | target_size | source_compression | target_compression | status | message |
|---------------+------------------+-------------+-------------+--------------------+--------------------+----------+---------|
| contacts.json | contacts.json.gz | 965 | 446 | NONE | GZIP | UPLOADED | |
+---------------+------------------+-------------+-------------+--------------------+--------------------+----------+---------+