Home Database Snowpipe & Snowpipe Streaming: Automated Data Ingestion in Snowflake
Intermediate 3 min · July 17, 2026
Snowpipe and Snowpipe Streaming: Automated Continuous Data Ingestion

Snowpipe & Snowpipe Streaming: Automated Data Ingestion in Snowflake

Learn how to automate continuous data ingestion into Snowflake using Snowpipe and Snowpipe Streaming.

N
Naren Founder & Principal Engineer

20+ years shipping high-throughput database systems. Notes here come from systems that actually shipped.

Follow
Production
production tested
2026-07-17T18:30:00
last updated
2,439
articles · all by Naren
Before you start⏱ 15-20 min read
  • Basic knowledge of SQL and Snowflake
  • Access to a Snowflake account with ACCOUNTADMIN privileges
  • Cloud storage bucket (AWS S3, Azure Blob, GCS) with appropriate permissions
 ● Production Incident 🔎 Debug Guide ⚙ Triage Commands
Quick Answer
  • Snowpipe automates loading of data from cloud storage (S3, Azure, GCS) as soon as new files arrive.
  • Snowpipe Streaming enables near-real-time ingestion via REST API without intermediate files.
  • Both use Snowflake's COPY command internally but are triggered automatically.
  • Key benefits: no manual loading, reduced latency, and automatic error handling.
  • Setup involves creating external stage, pipe object, and optional auto-ingest via event notifications.
✦ Definition~90s read
What is Snowpipe and Snowpipe Streaming?

Snowpipe is a fully managed service that automatically loads data from cloud storage into Snowflake tables as soon as new files arrive.

Imagine you have a mailbox (cloud storage) where letters (data files) arrive.
Plain-English First

Imagine you have a mailbox (cloud storage) where letters (data files) arrive. Snowpipe is like a mail sorter that automatically picks up each letter and files it into the correct folder (table) as soon as it arrives. Snowpipe Streaming is like a direct phone line where you can call in data instantly without writing a letter first.

In modern data pipelines, waiting for batch loads is a bottleneck. Snowflake's Snowpipe and Snowpipe Streaming solve this by automating continuous data ingestion. Snowpipe automatically loads new files from cloud storage (AWS S3, Azure Blob, GCS) as soon as they appear, using event notifications. Snowpipe Streaming goes further, allowing you to stream rows directly via a REST API, achieving sub-second latency. This tutorial covers both approaches, from setup to production debugging, with real-world examples. You'll learn how to create external stages, define pipes, monitor ingestion, and handle common pitfalls. By the end, you'll be able to build a robust, near-real-time data ingestion pipeline into Snowflake.

What is Snowpipe?

Snowpipe is a fully managed service that automates the loading of data from cloud storage into Snowflake tables. It uses the COPY command internally but is triggered automatically when new files arrive. Snowpipe supports AWS S3, Azure Blob Storage, and Google Cloud Storage. It can be configured with event notifications (SQS, Event Grid, Pub/Sub) to detect new files, or you can call the REST API to trigger a load. Snowpipe is ideal for near-real-time ingestion with latencies typically under a minute.

create_pipe.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- Create an external stage pointing to S3
CREATE OR REPLACE STAGE my_s3_stage
  URL = 's3://my-bucket/data/'
  CREDENTIALS = (AWS_KEY_ID = '...' AWS_SECRET_KEY = '...');

-- Define file format
CREATE OR REPLACE FILE FORMAT my_csv_format
  TYPE = CSV
  FIELD_OPTIONALLY_ENCLOSED_BY = '"'
  SKIP_HEADER = 1;

-- Create the pipe
CREATE OR REPLACE PIPE my_pipe
  AUTO_INGEST = TRUE
  AS
  COPY INTO my_table
  FROM @my_s3_stage
  FILE_FORMAT = my_csv_format;

-- Check pipe status
SELECT SYSTEM$PIPE_STATUS('my_pipe');
Output
+-------------------------------------------------------+
| SYSTEM$PIPE_STATUS('my_pipe') |
|-------------------------------------------------------|
| { |
| "executionState": "RUNNING", |
| "pendingFileCount": 0, |
| "lastIngestedTimestamp": "2025-03-15T10:30:00Z" |
| } |
+-------------------------------------------------------+
🔥Auto-Ingest vs. REST API
📊 Production Insight
Always set up monitoring on pipe status and file arrival to detect stalls early.
🎯 Key Takeaway
Snowpipe automates file-based ingestion using event notifications or REST API calls.

Setting Up Auto-Ingest with S3 Event Notifications

To enable auto-ingest, you need to configure an S3 bucket to send event notifications to an SQS queue, and then grant Snowflake access to that queue. Steps: 1) Create an SQS queue in AWS. 2) Configure S3 bucket to send events (s3:ObjectCreated:*) to the queue. 3) Create an IAM role that Snowflake can assume to read from the queue and the bucket. 4) In Snowflake, create a storage integration and pipe with AUTO_INGEST = TRUE. The pipe will automatically start loading files as they arrive. Below is a simplified example of the SQL to create the storage integration and pipe.

auto_ingest_setup.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- Create storage integration (requires AWS IAM role ARN)
CREATE OR REPLACE STORAGE INTEGRATION my_s3_int
  TYPE = EXTERNAL_STAGE
  STORAGE_PROVIDER = S3
  ENABLED = TRUE
  STORAGE_AWS_ROLE_ARN = 'arn:aws:iam::123456789012:role/my-snowflake-role'
  STORAGE_ALLOWED_LOCATIONS = ('s3://my-bucket/data/');

-- Create stage using integration
CREATE OR REPLACE STAGE my_stage
  URL = 's3://my-bucket/data/'
  STORAGE_INTEGRATION = my_s3_int
  FILE_FORMAT = my_csv_format;

-- Create pipe with auto-ingest
CREATE OR REPLACE PIPE my_pipe
  AUTO_INGEST = TRUE
  AWS_SNS_TOPIC = 'arn:aws:sns:us-east-1:123456789012:snowpipe-topic'
  AS
  COPY INTO my_table
  FROM @my_stage;
Output
Pipe MY_PIPE successfully created.
⚠ IAM Permissions
📊 Production Insight
Use separate SQS queues for different pipes to isolate failures.
🎯 Key Takeaway
Auto-ingest requires cloud-specific event notification setup and a storage integration.

Snowpipe Streaming: Real-Time Row Ingestion

Snowpipe Streaming is a newer feature that allows you to insert rows into Snowflake tables with sub-second latency using a REST API. Instead of waiting for files, you send rows directly via HTTP requests. This is ideal for streaming data from applications, IoT devices, or change data capture (CDC) systems. Snowpipe Streaming uses channels (similar to Kafka partitions) to ensure ordering and deduplication. Each channel is a sequence of rows that are committed in order. You can create multiple channels for parallelism. The client SDK (Java, Python) handles batching and retries. Below is an example using the Python SDK.

streaming_insert.pyPYTHON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from snowflake.ingest import SimpleIngestManager
from snowflake.ingest import StagedFile
from snowflake.ingest.utils.urllib import urllib

# Initialize ingest manager
manager = SimpleIngestManager(
    account='myaccount',
    user='myuser',
    password='mypassword',
    pipe='mydb.myschema.mypipe',
    host='myaccount.snowflakecomputing.com'
)

# Create a staged file reference
staged_file = StagedFile('s3://my-bucket/data/file.csv', None)

# Ingest the file
manager.ingest([staged_file])
print('File ingested successfully')
Output
File ingested successfully
💡Streaming vs. File-Based
📊 Production Insight
Monitor channel offsets to detect lag; use unique channel names for each producer.
🎯 Key Takeaway
Snowpipe Streaming enables row-level, sub-second ingestion via REST API.

Monitoring and Managing Snowpipe

Snowflake provides several views and functions to monitor Snowpipe activity. Key views: INFORMATION_SCHEMA.COPY_HISTORY shows load history per table; SNOWPIPE_STATUS function gives current pipe state; LOAD_HISTORY shows file-level load details. You can also use ACCOUNT_USAGE views for historical data. To manage pipes, you can pause, resume, drop, or refresh them. Refreshing a pipe re-ingests files from the stage that have not been loaded yet. This is useful for recovery. Below are common monitoring queries.

monitor_pipes.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- Check pipe status
SELECT SYSTEM$PIPE_STATUS('mydb.myschema.mypipe');

-- View recent copy history
SELECT *
FROM TABLE(INFORMATION_SCHEMA.COPY_HISTORY(
    TABLE_NAME=>'mytable',
    START_TIME=>DATEADD(hours, -24, CURRENT_TIMESTAMP())))
ORDER BY LAST_LOAD_TIME DESC;

-- View load history for a pipe
SELECT *
FROM TABLE(INFORMATION_SCHEMA.LOAD_HISTORY(
    PIPE_NAME=>'mydb.myschema.mypipe',
    START_TIME=>DATEADD(hours, -24, CURRENT_TIMESTAMP())));

-- Pause a pipe
ALTER PIPE mypipe SET PIPE_EXECUTION_PAUSED = TRUE;

-- Resume a pipe
ALTER PIPE mypipe SET PIPE_EXECUTION_PAUSED = FALSE;

-- Refresh a pipe (re-ingest missed files)
ALTER PIPE mypipe REFRESH;
Output
+-------------------------------------------------------+
| SYSTEM$PIPE_STATUS('mydb.myschema.mypipe') |
|-------------------------------------------------------|
| { "executionState": "RUNNING", ... } |
+-------------------------------------------------------+
+-------------------------------+------------------+----+
| FILE_NAME | STATUS | ... |
|-------------------------------+------------------+----|
| s3://my-bucket/data/file1.csv | LOADED | |
| s3://my-bucket/data/file2.csv | LOAD_FAILED | |
+-------------------------------+------------------+----+
🔥Refresh vs. Recreate
📊 Production Insight
Set up alerts on pipe status changes (e.g., paused or failed) using Snowflake's notification integrations.
🎯 Key Takeaway
Regularly monitor pipe status and copy history to ensure data is flowing.

Error Handling and Data Validation

Snowpipe can encounter errors like malformed files, schema mismatches, or permission issues. By default, Snowpipe skips files with errors and continues. You can configure error handling using the ON_ERROR option in the COPY command within the pipe definition. Options: CONTINUE (default), SKIP_FILE, SKIP_FILE_% (skip a percentage), ABORT_STATEMENT. For Snowpipe Streaming, errors are returned in the API response; you should implement retry logic. Use VALIDATE function to test files before loading. Below is an example of a pipe with error handling.

error_handling.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- Create pipe with error handling
CREATE OR REPLACE PIPE my_pipe
  AUTO_INGEST = TRUE
  AS
  COPY INTO my_table
  FROM @my_stage
  FILE_FORMAT = my_csv_format
  ON_ERROR = 'SKIP_FILE';

-- Validate a file before loading
SELECT *
FROM TABLE(
    VALIDATE(my_table, JOB_ID => '_last')
);

-- View load errors
SELECT *
FROM TABLE(INFORMATION_SCHEMA.COPY_HISTORY(
    TABLE_NAME=>'mytable',
    START_TIME=>DATEADD(hours, -1, CURRENT_TIMESTAMP())))
WHERE STATUS = 'LOAD_FAILED';
Output
+----------+------------------+----------------+
| FILE | STATUS | ERROR |
|----------+------------------+----------------|
| file.csv | LOAD_FAILED | Invalid UTF-8 |
+----------+------------------+----------------+
⚠ Schema Evolution
📊 Production Insight
Set up a dead-letter queue for files that fail repeatedly to investigate later.
🎯 Key Takeaway
Configure error handling in the pipe definition and use VALIDATE to test files.

Performance Optimization and Best Practices

To optimize Snowpipe performance: 1) Use compressed files (gzip, snappy) to reduce transfer time. 2) Partition files by date or other keys to avoid large scans. 3) Set appropriate file sizes (100-250 MB compressed) to balance parallelism. 4) Use multiple pipes for different tables or partitions. 5) For Snowpipe Streaming, batch rows in the client (e.g., 1000 rows per request) and use multiple channels. 6) Monitor the Snowpipe ingestion queue length; if it grows, increase the number of pipes or reduce file size. Below is an example of a pipe with optimized settings.

optimized_pipe.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- Create a pipe with optimized settings
CREATE OR REPLACE PIPE my_optimized_pipe
  AUTO_INGEST = TRUE
  AS
  COPY INTO my_table
  FROM (
    SELECT $1, $2, $3, METADATA$FILENAME, METADATA$FILE_ROW_NUMBER
    FROM @my_stage
  )
  FILE_FORMAT = (TYPE = CSV COMPRESSION = GZIP)
  ON_ERROR = CONTINUE;

-- Use clustering on the table for better query performance
ALTER TABLE my_table CLUSTER BY (ingestion_date);
Output
Pipe MY_OPTIMIZED_PIPE successfully created.
💡File Size Matters
📊 Production Insight
Use METADATA$FILENAME and METADATA$FILE_ROW_NUMBER to track data lineage.
🎯 Key Takeaway
Optimize file size, compression, and partitioning for best Snowpipe performance.
● Production incidentPOST-MORTEMseverity: high

The Midnight Ingestion Stall: When Snowpipe Missed Files

Symptom
Users saw stale data in dashboards; no new records appeared after midnight.
Assumption
The developer assumed Snowpipe was continuously polling the S3 bucket.
Root cause
The S3 event notification (SQS queue) had a misconfigured filter that excluded files with a new naming pattern.
Fix
Updated the S3 event notification filter to include the new prefix and replayed missed files using ALTER PIPE ... REFRESH.
Key lesson
  • Always monitor Snowpipe's status using SYSTEM$PIPE_STATUS.
  • Set up alerts for pipes that have been idle longer than expected.
  • Use file naming conventions consistently to avoid filter mismatches.
  • Test event notifications end-to-end before production.
  • Have a manual refresh plan for recovery.
Production debug guideSymptom to Action4 entries
Symptom · 01
No new data loaded despite files arriving in storage
Fix
Check pipe status with SYSTEM$PIPE_STATUS; verify event notification is configured and accessible.
Symptom · 02
Files loaded but with errors (partial loads)
Fix
Query COPY_HISTORY view to see error details; validate file format and schema.
Symptom · 03
High latency between file arrival and load
Fix
Check Snowpipe ingestion queue length; consider increasing pipe's file size or using Snowpipe Streaming.
Symptom · 04
Snowpipe Streaming errors (HTTP 429 or timeout)
Fix
Implement exponential backoff in client; check Snowflake account limits for streaming.
★ Quick Debug Cheat SheetCommon Snowpipe issues and immediate actions
No data loaded
Immediate action
Check pipe status
Commands
SELECT SYSTEM$PIPE_STATUS('mydb.myschema.mypipe');
SELECT * FROM TABLE(INFORMATION_SCHEMA.COPY_HISTORY(TABLE_NAME=>'mytable', START_TIME=>DATEADD(hours, -1, CURRENT_TIMESTAMP())));
Fix now
If pipe is paused, resume with ALTER PIPE mypipe SET PIPE_EXECUTION_PAUSED = FALSE;
Files stuck in queue+
Immediate action
Force refresh pipe
Commands
ALTER PIPE mypipe REFRESH;
SELECT * FROM TABLE(INFORMATION_SCHEMA.LOAD_HISTORY());
Fix now
If refresh fails, drop and recreate pipe after verifying stage and file format.
Streaming insert fails+
Immediate action
Check client logs for HTTP status
Commands
Check Snowflake account usage for streaming channels
SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.SNOWPIPE_STREAMING_CHANNELS;
Fix now
Recreate channel with unique name and retry.
FeatureSnowpipeSnowpipe Streaming
Data sourceFiles in cloud storageRows via REST API
LatencySeconds to minutesSub-second
Setup complexityRequires event notificationsClient SDK integration
Cost modelPer credit (compute)Per row ingested
Use caseBatch/near-real-time file loadsReal-time streaming from apps/CDC
⚙ Quick Reference
6 commands from this guide
FileCommand / CodePurpose
create_pipe.sqlCREATE OR REPLACE STAGE my_s3_stageWhat is Snowpipe?
auto_ingest_setup.sqlCREATE OR REPLACE STORAGE INTEGRATION my_s3_intSetting Up Auto-Ingest with S3 Event Notifications
streaming_insert.pyfrom snowflake.ingest import SimpleIngestManagerSnowpipe Streaming
monitor_pipes.sqlSELECT SYSTEM$PIPE_STATUS('mydb.myschema.mypipe');Monitoring and Managing Snowpipe
error_handling.sqlCREATE OR REPLACE PIPE my_pipeError Handling and Data Validation
optimized_pipe.sqlCREATE OR REPLACE PIPE my_optimized_pipePerformance Optimization and Best Practices

Key takeaways

1
Snowpipe automates file-based ingestion from cloud storage with auto-ingest or REST API.
2
Snowpipe Streaming enables sub-second row-level ingestion via REST API.
3
Monitor pipe status and copy history to ensure data flows correctly.
4
Configure error handling and use VALIDATE to test files before production.
5
Optimize file size, compression, and partitioning for best performance.

Common mistakes to avoid

4 patterns
×

Forgetting to grant Snowflake access to the SQS queue

×

Using AUTO_INGEST without setting up event notifications

×

Not monitoring pipe status and copy history

×

Assuming Snowpipe Streaming is exactly like file-based Snowpipe

INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01JUNIOR
What is Snowpipe and how does it differ from manual COPY commands?
Q02SENIOR
Explain how auto-ingest works with Snowpipe on AWS S3.
Q03SENIOR
How would you handle a scenario where Snowpipe stops loading data withou...
Q01 of 03JUNIOR

What is Snowpipe and how does it differ from manual COPY commands?

ANSWER
Snowpipe is a managed service that automates data loading from cloud storage. Unlike manual COPY, it triggers automatically on file arrival, reducing latency and manual effort.
FAQ · 5 QUESTIONS

Frequently Asked Questions

01
What is the difference between Snowpipe and Snowpipe Streaming?
02
How do I recover missed files in Snowpipe?
03
Can Snowpipe handle schema changes?
04
What are the costs associated with Snowpipe?
05
How do I set up Snowpipe for Azure Blob Storage?
N
Naren Founder & Principal Engineer

20+ years shipping high-throughput database systems. Notes here come from systems that actually shipped.

Follow
Verified
production tested
2026-07-17T18:30:00
last updated
2,439
articles · all by Naren
🔥

That's Snowflake. Mark it forged?

3 min read · try the examples if you haven't

Previous
Semi-Structured Data: JSON, Parquet, Avro, and VARIANT
14 / 33 · Snowflake
Next
Stored Procedures, UDFs, and Snowflake Scripting