Step 6. Summary and Clean Up¶
Congratulations! You have successfully completed this introductory tutorial.
Please take a few minutes to review a short summary and the key points covered in the tutorial. You might also want to consider cleaning up by dropping any objects you created in the tutorial. And, at the bottom of the page, we provide some links to other topics in the Snowflake Documentation that you can use to learn more.
In this Topic:
Tutorial Summary and Key Points¶
In summary, data loading is performed in 2 steps:
|Step 1:||Stage the files containing the data to be loaded. The files can be staged internally (in Snowflake) or in an external location.|
|Step 2:||Copy data from the staged files into a target table. A running, active warehouse is required for this step. Also, to perform this step, you must have an existing table into which the data from the files will be loaded.|
Some key points to remember about loading CSV files:
A CSV file consists of 1 or more records, with 1 or more fields in each record, and sometimes a header record.
Records and fields in each file are separated by delimiters. The default delimiters are:
Records: newline characters Fields: commas
In other words, Snowflake expects each record in a CSV file to be separated by newlines and the fields (i.e. individual values) in each record to be separated by commas. If different characters are used as record and field delimiters, you must explicitly specify this as part of the file format when loading.
There is a direct correlation between the fields in the files and the columns in the table you will be loading, in terms of:
- Number of fields (in the file) and columns (in the target table).
- Positions of the fields and columns within their respective file/table.
- Data types, such as string, number, or date, for fields and columns.
If the numbers, positions, and data types don’t all align, the records will not be loaded.
Snowflake supports loading files in which the fields don’t exactly align with the columns in the target table; however, this is a more advanced data loading topic (covered in Transforming Data During a Load).
Tutorial Clean Up (Optional)¶
Execute the following DROP <object> statements to return your system to its state before you began the tutorial:
DROP DATABASE IF EXISTS sf_tuts; DROP WAREHOUSE IF EXISTS sf_tuts_wh;
Before you drop the warehouse, consider whether you are going to complete any of the other tutorials, which all require a warehouse. You might be able to save some time and credits by reusing this warehouse for the other tutorials.
We recommend continuing learning about Snowflake using the following resources:
Watch the Getting Started introductory videos and complete the other tutorials provided by Snowflake:
Familiarize yourself with key Snowflake concepts and features, as well as the SQL commands used to perform queries and insert/update data: