<aside> šŸ’”

In Snowflake, a stage represents a named object that acts as a temporary holding area for data files being loaded into a Snowflake table. The data can be stored in either Snowflake internal storage or external storage services like Amazon S3 or Microsoft Azure. A stage provides a way to manage and control access to the data being loaded into Snowflake.

</aside>

Snowflake stages

// Create stage table
CREATE OR REPLACE TABLE MENU
(
	menu_id NUMBER(19,0),
	...
);

// Create external stage
CREATE OR REPLACE STAGE my_stage
url = 's3://path_to_file/'
file_format = (type = csv);

// Load from external stage into stage table
COPY INTO menu
FROM @my_stage/file.csv;

Listing items from stage

CREATE OR REPLACE STAGE my_stage
url = 's3://path_to_file/'

---> query the Stage to find file
LIST @my_stage

Best Practices for Managing Snowflake Stages

Some of the best practices to manage Snowflake stages are as follows:

  1. Create a stage for each external data source. This will ensure that users can easily access the external data and move it to the Snowflake table.
  2. Use the Snowflake table staging process. This process allows users to load data into a temporary table before loading it into the main Snowflake table. This allows businesses to ensure that their data is properly loaded without having to worry about any potential problems that may arise during the loading process.
  3. Leverage the Snowflake COPY INTO the stage table process.Ā This process allows users to control the data transfer process and protect their data from unauthorized access.

What Are Snowflake Stages?