Step 6. Remove the Successfully Copied Data Files¶
After you verify that you successfully copied data from your stage into the tables, you can remove data files from the internal stage using the REMOVE command to save on data storage.
REMOVE @my_csv_stage PATTERN='.*.csv.gz';
Snowflake returns the following results:
+-------------------------------+---------+ | name | result | |-------------------------------+---------| | my_csv_stage/contacts1.csv.gz | removed | | my_csv_stage/contacts4.csv.gz | removed | | my_csv_stage/contacts2.csv.gz | removed | | my_csv_stage/contacts3.csv.gz | removed | | my_csv_stage/contacts5.csv.gz | removed | +-------------------------------+---------+REMOVE @my_json_stage PATTERN='.*.json.gz';
Snowflake returns the following results:
+--------------------------------+---------+ | name | result | |--------------------------------+---------| | my_json_stage/contacts.json.gz | removed | +--------------------------------+---------+
Next: Step 7. Clean Up