Loading Files into Stage through Snowflake UI — The Complete Guide
--
We can now load the files into Snowflake named internal stages using Snowsight UI and here is the step by step guide how it can be done. We can view the files and use the files to load data from files into tables.
1) Creating named internal stage
Create a named internal stage, logging into Snowflake Snowsight UI.
1a) In navigation menu after selecting Data → Databases, select the specific database and schema where you want to create stage and select Create → Stage → Snowflake Managed
1b) Enter the stage name, here is is name demo_stage and Enabe Directory Table, so that you can see the files that you upload and select Create.
1c) Select the warehouse to refresh the directory table once the stage is created.
Currently in the stage, there are would be no files.
2) Loading files into named internal stage
2a) In the stage you want to load the files, select + Files
2b) Drag and drop the files or Upload files in the Upload Your Files dialog and select Upload.
Note multiple files that doesn’t exceed 50MB in size each only can be uploaded. To load larger files, use the Snowflake client, SnowSQL.
Here uploaded contacts1.csv and contacts2.csv files.
2c) The 2 files uploaded can be seen under stage name DEMO_STAGE
3) Loading files into named internal stage using multiple paths
Optionally creating paths within the stage
3a) Creating csv folder within demo_stage and uploading csv files
Can observe csv folder created
And it has 2 files uploaded
3b) Creating a different folder json for json files
Can observe json folder created in addition to csv folder
and json folder has the file uploaded to it
By creating multiple paths you can organize the file data well, in a structured manner within a stage.
Using the files in the stage, we can query the stage data or copy data from staged files into a table.
4) Managing stages
You can manage the stage in below ways -
Edit to edit the name and comment for the stage object.
Clone to clone the stage.
Drop to drop, or remove, the stage.
Transfer Ownership to transfer OWNERSHIP privileges of the stage to another role.
Additionally to manage privileges for the stage, use the Privileges section to view, grant, and revoke privileges.
Note: We cannot load files into user stages or table stages using UI and for it have to use the Snowflake client, SnowSQL.
References: https://docs.snowflake.com/en/user-guide/data-load-local-file-system-stage-ui
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.