We can now load the data from files into Snowflake tables using Snowsight UI and here is the step by step guide how it can be done. This is very beneficial when we want to load the files data quickly in DEV or QA Snowflake environments.
- Logged into Snowsight UI, in navigation menu after selecting Data → Databases, select the table you want to load under its specific Database and Schema and select Load Data.
2. Select the warehouse to proceed and click on Next.
Note this screen would come when you are loading the table for the first time.
3. Drag and drop a file or Upload a file in the Load Data into Table dialog and select Next.
Note only 1 file that doesn’t exceed 50MB in size only can be loaded at a time. To load larger files, or large numbers of files, use the Snowflake client, SnowSQL.
Here I have uploaded contacts1.csv file
4. Select a File format with customized format or existing file_format on the database.
If customizing select the relevant settings for your data file.
Here I am using csv file with pipe delimiter and has a header.
So skipping 1 line of header and choosing Vertical Bar as filed delimiter in the file format options.
5. Optionally you can change the default setting of what should happen if an error is encountered when loading the file and select Next.
I have chosen ON_ERROR = CONTINUE to proceed.
6. Optionally if you click on Show SQL, we can see the sql statement that would run in the backend based on the options selected. You can Hide SQL and select Next.
7. Snowflake loads the file and displays the number of rows successfully inserted into the table.
8. Select Query Data to open a worksheet with SQL syntax for querying your table, or select Done to close the dialog.
9. If your file fails to load, an error message appears. For example, if the columns in the file that you want to load into the table do not match the columns specified in the table, you see an error. Select Back to adjust settings or Done to exit the Load Data dialog.
Follow and Clap if you like the content and feel free to ask if you have any questions in the comments. I will be more than happy to assist and guide you.