0
0
Snowflakecloud~10 mins

Snowpipe for event-driven loading in Snowflake - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Snowpipe for event-driven loading
New file arrives in cloud storage
Cloud event triggers notification
Snowpipe receives event
Snowpipe loads new data into table
Data available for queries
END
Snowpipe listens for new files in cloud storage via events, then automatically loads data into Snowflake tables.
Execution Sample
Snowflake
CREATE PIPE my_pipe
  AUTO_INGEST = TRUE
  INTEGRATION = my_notification_integration
  AS COPY INTO my_table
  FROM @my_stage
  FILE_FORMAT = (TYPE = 'CSV');
This code creates a Snowpipe that automatically loads CSV files from a stage into a table when new files arrive.
Process Table
StepEventSnowpipe ActionData StateNotes
1File uploaded to cloud storageNo action yetNo new data in tableWaiting for event
2Cloud event sent to SnowpipeSnowpipe receives eventNo new data in tableTrigger received
3Snowpipe starts loading fileCOPY INTO runsData loading in progressFile being processed
4Load completes successfullyData loaded into tableNew data availableReady for queries
5No new filesNo actionData unchangedIdle state
💡 No new files to load, Snowpipe waits for next event
Status Tracker
VariableStartAfter Step 2After Step 3After Step 4Final
File in storageAbsentPresentPresentPresentPresent
Snowpipe statusIdleTriggeredLoadingCompletedIdle
Table dataOld data onlyOld data onlyLoading dataNew data addedNew data present
Key Moments - 3 Insights
Why doesn't Snowpipe load data immediately when a file is uploaded?
Snowpipe waits for a cloud event notification (see Step 2 in execution_table) before starting to load data.
What happens if the file load fails during Snowpipe processing?
Snowpipe retries loading the file until success or manual intervention; this is not shown in the simple flow but is part of Snowpipe's reliability.
Can Snowpipe load multiple files at once?
Yes, Snowpipe can process multiple events and load files concurrently, but each event triggers a separate load operation.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step does Snowpipe start loading the file?
AStep 3
BStep 2
CStep 1
DStep 4
💡 Hint
Check the 'Snowpipe Action' column for when 'COPY INTO runs'
According to variable_tracker, what is the Snowpipe status after Step 4?
ALoading
BTriggered
CCompleted
DIdle
💡 Hint
Look at 'Snowpipe status' value under 'After Step 4'
If no new files arrive, what does Snowpipe do according to the execution_table?
AStarts loading old files
BWaits idle with no action
CDeletes old data
DSends error notification
💡 Hint
See Step 5 'Snowpipe Action' and 'Notes' columns
Concept Snapshot
Snowpipe automatically loads data into Snowflake tables when new files arrive in cloud storage.
It listens for cloud event notifications to trigger loading.
Use CREATE PIPE with AUTO_INGEST=TRUE to enable event-driven loading.
Snowpipe runs COPY INTO commands behind the scenes.
Data becomes available for queries immediately after loading.
Snowpipe handles retries and scales with file arrivals.
Full Transcript
Snowpipe is a Snowflake feature that loads data automatically when new files arrive in cloud storage. The process starts when a file is uploaded, which triggers a cloud event notification. Snowpipe listens for this event and then runs a COPY INTO command to load the data into a Snowflake table. After loading completes, the new data is available for queries. If no new files arrive, Snowpipe remains idle, waiting for the next event. This event-driven loading helps keep data fresh without manual intervention.