What you will be able to do
- Classify a source as data at rest (files) or data in motion (rows and events) and pick the matching ingestion path
- Choose between bulk COPY INTO, Snowpipe auto-ingest, the Snowpipe REST API and Snowpipe Streaming on latency, compute and billing
- Explain how CDC feeds from OLTP databases, Kafka topics and API sources reach Snowflake
- Decide when to query data in place with an external table or an Iceberg table, and tell Snowflake-managed Iceberg tables apart from externally managed ones
- Set COPY INTO parameters such as VALIDATION_MODE, ENFORCE_LENGTH, MATCH_BY_COLUMN_NAME, INCLUDE_METADATA and TRIM_SPACE to catch or absorb data handling errors before rows reach a table
Key concept
Ingestion path follows arrival shape — Files that already sit in cloud storage (data at rest) are loaded with COPY INTO, either in scheduled batches or continuously by Snowpipe. Rows that are produced continuously (data in motion) are written straight into tables with Snowpipe Streaming. The volume of data and how often it arrives decide between them.
1.Data at rest, data in motion, and where files must be
Every loading design starts with one question: does the data arrive as files or as rows? Data at rest is something that has already been written to storage, such as a partner's nightly export, an application's log files, or a dump from a legacy system. Data in motion is produced continuously: sensor readings, clickstream events, Kafka messages, and change records from an OLTP database. Snowflake's loading options split along this same line. Inside each half, the choice depends on how much data arrives and how often.
For files, Snowflake calls the storage location a stage. The same COPY INTO <table> command does both bulk and continuous (Snowpipe) loads. It reads from internal stages, which are user, table and named stages filled with PUT, and from external stages in Amazon S3, Google Cloud Storage or Microsoft Azure. It doesn't matter which cloud hosts the Snowflake account. The stage types and file format objects themselves are covered in Stages and file formats. This lesson is about choosing the format options for each source, for example TYPE = JSON with STRIP_OUTER_ARRAY for a JSON export, or TYPE = PARQUET for a data lake extract.
External sources come with two limits. First, files in archival storage classes such as S3 Glacier Flexible Retrieval, Glacier Deep Archive or Azure Archive Storage can't be loaded until they are restored. Second, loading from a bucket in a different region or on a different cloud can add data transfer charges. A pipeline that reads a bucket on another continent works, but someone pays for the transfer.
Checkpoint 1 of 8· Check yourself
Your Snowflake account runs on Microsoft Azure. A partner puts nightly CSV exports in an Amazon S3 bucket in another region. After 90 days, a lifecycle rule moves older exports to S3 Glacier Deep Archive. You point an external stage at the bucket and run COPY INTO. Which statement is correct?
COPY INTO reads S3, GCS and Azure no matter which cloud hosts the account, though loading across regions or clouds can add transfer charges. Archival storage classes such as Glacier Deep Archive can't be read until the files are restored.
“You cannot access data held in archival cloud storage classes that requires restoration before it can be retrieved.”Source: docs.snowflake.com
Sources1
2.Bulk COPY versus Snowpipe for files
| Characteristic | Bulk loading with COPY INTO | Snowpipe | Snowpipe Streaming |
|---|---|---|---|
| Data source | Files in a stage | Files in a stage | Rows sent by the SDK, REST API or Kafka connector |
| How loading starts | You run COPY INTO, manually or on a schedule such as a task | Cloud storage event notification, or a call to the Snowpipe REST API | Continuously, as the client sends rows |
| Typical latency | Depends on how often you run the load | Typically within a minute after Snowpipe learns about a file | As low as 5 seconds |
| Compute | A virtual warehouse that you size and manage | Serverless | Serverless |
| Billing | Warehouse credits while the warehouse runs | Fixed credits per GB loaded | Credits per uncompressed GB ingested |
Bulk loading suits large one-time loads and scheduled batches. COPY runs on a warehouse named in the statement, and you size that warehouse for the load. During the load, COPY can reorder columns, omit columns, cast values and truncate strings that are too long. You can also narrow which files it reads. A path in the FROM clause acts as a literal prefix, and PATTERN applies a regular expression. Both work best when the lake uses date-based folders, as described in Data warehouse zones/layers and data lake directory structure. For external stages, credentials come from a Storage integrations object rather than from keys written into the statement.
Snowpipe is for files that keep arriving throughout the day when nobody wants to schedule batches. A pipe is a schema object that wraps one COPY statement. Snowflake runs that statement for each new file on serverless compute, so there is no warehouse to size, resume or suspend. Billing is a fixed number of credits per GB. For text files that means the uncompressed size, and for binary files the size in storage.
CREATE PIPE mydb.myschema.orders_pipe
AUTO_INGEST = TRUE
AS
COPY INTO mydb.myschema.orders
FROM @mydb.myschema.orders_stage
FILE_FORMAT = (TYPE = 'JSON')
MATCH_BY_COLUMN_NAME = CASE_INSENSITIVE;With AUTO_INGEST = TRUE, the cloud provider tells Snowpipe that a file has landed. On S3, the event notifications travel through Amazon SQS, Amazon SNS or Amazon EventBridge. The SQS queue Snowpipe reads from is the pipe's notification channel, and it appears in SHOW PIPES output. Google Cloud Storage uses Pub/Sub plus a notification integration. Azure uses Event Grid, a storage queue and a notification integration. Without auto-ingest, your application calls the REST API's insertFiles endpoint and authenticates with a key pair or workload identity federation. This option also works for named internal stages and table stages.
Each pipe keeps load metadata: a record of the files it has processed in the last 14 days, failed files included. Snowpipe ignores any staged file whose path and name match that record, and that is what prevents the same file from loading twice. You can't edit a pipe in place. To change its COPY statement, you recreate the pipe, and recreating it drops the load metadata, so a later refresh can queue files the old pipe already loaded and duplicate them. Neither Snowpipe nor bulk loading can join, aggregate or filter rows. The usual pattern is to land the raw data first and transform it afterwards, as covered in data transformation.
Checkpoint 2 of 8· Fill the gap
Partner exports land in an external stage at unpredictable times. The team wants each file loaded as soon as the cloud storage service reports that it has arrived, with no application calling the REST API. Which property completes the pipe definition?
CREATE PIPE mydb.myschema.orders_pipe
? = TRUE
AS
COPY INTO mydb.myschema.orders
FROM @mydb.myschema.orders_stage
FILE_FORMAT = (TYPE = 'JSON')
MATCH_BY_COLUMN_NAME = CASE_INSENSITIVE;AUTO_INGEST = TRUE turns on automated loading, so Snowpipe loads each new file when cloud storage sends an event notification. Without it (the default is FALSE), an application has to call the Snowpipe REST API's insertFiles endpoint to name the files to load.
Source: docs.snowflake.comCheckpoint 3 of 8· Exam question
A retailer's point-of-sale system drops new CSV files into an S3 bucket every few minutes, and the analytics team wants each file to load into Snowflake within a couple of minutes of arrival without provisioning or babysitting a warehouse for this job. Which approach best fits this requirement?
Correct answer: A — Configure Snowpipe with auto-ingest so cloud storage event notifications queue each new file for near-real-time loading on serverless compute.
- A. Correct - Snowpipe's auto-ingest mode reacts to cloud storage event notifications and loads newly landed files within minutes using Snowflake-managed compute, matching the low-latency, hands-off requirement described.
- B. Incorrect - a scheduled Task with a dedicated warehouse works, but it requires provisioning and paying for that warehouse continuously, which is exactly the operational overhead the team wants to avoid.
- C. Incorrect - an external table leaves the data in the bucket and queries it in place, which does not satisfy the requirement to load the files into Snowflake.
- D. Incorrect - Snowpipe Streaming ingests rows directly from an application without staged files, but the scenario describes files already landing in S3, which is exactly what Snowpipe auto-ingest is built to consume.
Checkpoint 4 of 8· Exam question
When an architect configures Snowpipe auto-ingest for files landing in an Amazon S3 bucket, which AWS service does Snowflake poll to learn that new files have arrived and should be queued for loading?
Correct answer: A — Amazon Simple Queue Service receiving S3 event notifications that Snowpipe polls to discover newly arrived files.
- A. Correct - on AWS, S3 event notifications are delivered to an SQS queue, and Snowpipe polls that queue to discover newly staged files for auto-ingest loading.
- B. Incorrect - CloudWatch Events is not the notification path Snowpipe auto-ingest relies on for discovering new S3 objects; the documented mechanism is SQS-based event delivery.
- C. Incorrect - auto-ingest does not depend on a customer-managed Lambda function pushing filenames; Snowpipe itself polls the SQS queue that S3 populates automatically.
- D. Incorrect - Kinesis Data Streams is not part of the standard Snowpipe auto-ingest architecture; S3 event notifications are delivered through SQS instead.
3.Rows in motion: Snowpipe Streaming, CDC, OLTP and API sources
Snowpipe Streaming removes the file entirely. A client writes rows directly into a standard table or a Snowflake-managed Iceberg table, and the data can be queryable in as little as 5 seconds. The client can be the Java, Python or Node.js SDK, the REST API (intended for IoT devices and edge deployments), or the Kafka connector. Compute is serverless and scales with load, and billing is per uncompressed GB ingested. Use it when data arrives as rows and seconds matter. Use Snowpipe when the pipeline already produces files and a minute or more of latency is acceptable.
The channel type decides the delivery guarantee. Elastic Channels are the default for new applications. Producers simply write, Snowflake manages the channels, and delivery is at-least-once with no ordering guarantee. Named Channels use offset tokens to give ordered, exactly-once ingestion within each channel. That is what a CDC feed or a Kafka partition needs, because applying an update before its insert corrupts the target. The pipe object can also apply COPY-style transformations while rows are in flight.
Several source types each map to a path. For Kafka, the Snowflake Connector for Kafka can load through Snowpipe (file-based) or through Snowpipe Streaming. Streaming is the lower-latency and lower-cost upgrade. For OLTP databases and SaaS applications, an Openflow connector ingests directly from the source system. For a REST API with no connector, a stored procedure can call out through an External access integrations (outbound network access) object and write the response into a table.
Region outages are a separate architecture concern. With Business Critical Edition and account replication, bulk COPY and Snowpipe auto-ingest pipelines can fail over to a storage location in another region or cloud. Snowpipe Streaming and Openflow do not support this failover.
Checkpoint 5 of 8· Check yourself
A CDC feed from an OLTP order database arrives through Kafka, one partition per table. Change records must show up in Snowflake within seconds. If an update is applied before its insert, the target table is corrupted. Which ingestion design fits?
CDC needs strict ordering and exactly-once delivery, which Named Channels provide with offset tokens. Elastic Channels deliver at-least-once with no ordering guarantee. File-based Snowpipe or a scheduled COPY adds a minute or more of latency, which misses the seconds-level target.
“Named Channels provide ordered, exactly-once ingestion within each channel by using offset tokens.”Source: docs.snowflake.com
Checkpoint 6 of 8· Exam question
A manufacturer's IoT sensors emit thousands of small readings per second, and the operations team needs each reading queryable in Snowflake within about five seconds without writing the readings to files first. Which ingestion approach best satisfies this latency and volume profile?
Correct answer: A — Use Snowpipe Streaming so the sensor application writes rows directly into the target table without any intermediate staged files.
- A. Correct - Snowpipe Streaming ingests rows directly from an application into a table, bypassing file staging entirely, and is built for the low-latency, high-throughput profile this sensor workload describes.
- B. Incorrect - Snowpipe still requires files to be staged first and typically delivers data within minutes rather than seconds, which does not meet the near-real-time latency target.
- C. Incorrect - a per-minute scheduled COPY INTO job still depends on files being staged beforehand and adds scheduling latency on top, missing the five-second requirement.
- D. Incorrect - querying an external table over appended raw files adds file-listing and read overhead per query and does not give the sub-ten-second freshness a streaming write path provides.
4.Querying in place: external tables and Iceberg tables
Sometimes the right answer is not to load the data at all. An external table queries files in an external stage as if they were a table, while the files themselves stay in your cloud storage. External tables are read-only: you can query them, join them and create views on them, but you can't run DML against them. Queries can be slower than on native tables, so the usual remedy is a materialized view over the subset people actually use. This option works well for an account with a large archive in a bucket where analysts only need the most recent slice.
Partitioning is where the lake's folder layout pays off. Each partition column is an expression that parses the path stored in the METADATA$FILENAME pseudocolumn. For example, TO_DATE(SPLIT_PART(metadata$filename, '/', 3) ...) turns logs/2018/08/05/ into a date. A query that filters on that column then scans only the matching files. New files become visible when the table's metadata refreshes. That can happen automatically with AUTO_REFRESH = true and cloud event notifications, or manually with ALTER EXTERNAL TABLE ... REFRESH. If you choose PARTITION_TYPE = USER_SPECIFIED, the owner adds partitions by hand. That mode is used to stay in sync with metastores such as AWS Glue or Hive, and it does not support automatic refresh.
| Aspect | Snowflake-managed (Snowflake as catalog) | Externally managed (external catalog) |
|---|---|---|
| Snowflake platform support | Full, with read and write access | Limited; Snowflake reads metadata through a catalog integration |
| Lifecycle maintenance | Snowflake handles it, including compaction | Snowflake does not assume any life-cycle management |
| Where files live | Snowflake storage, or your cloud storage via an external volume | Your cloud storage via an external volume |
| Replication for tables | Supported | Not listed |
Iceberg tables keep the data in an open format. An Iceberg catalog is the service that holds a table's Iceberg metadata and schema, so any engine reading the table learns its structure from the catalog. Two Snowflake objects connect a table to the outside world. An external volume gives Snowflake access to a cloud storage location. A catalog integration is an account-level object that tells Snowflake how to reach an external catalog such as AWS Glue; a table that uses Snowflake as its catalog doesn't need one.
With those pieces defined, the question is who owns the catalog. Choose a Snowflake-managed table when Snowflake is the main engine and you want full platform features. Choose an externally managed table when another engine or catalog, such as AWS Glue or a remote Iceberg REST catalog, remains the system of record. An externally managed table can later be converted with ALTER ICEBERG TABLE ... CONVERT TO MANAGED. Loading follows the same split: Snowpipe can load both kinds, but Snowpipe Streaming targets only Snowflake-managed Iceberg tables.
Checkpoint 7 of 8· Check yourself
An analytics team keeps its Iceberg tables in AWS Glue, which stays the system of record, so Snowflake sees them as externally managed Iceberg tables. A new IoT feed has to write rows into one of these tables with Snowpipe Streaming so they can be queried within seconds. What should the architect tell them?
Snowpipe Streaming targets standard tables and Snowflake-managed Iceberg tables only, while Snowpipe's pipe syntax also works for externally managed Iceberg tables. External tables are read-only, so nothing can stream rows into them.
“stream rows directly from devices, applications, and services into Snowflake tables or Snowflake-managed Apache Iceberg tables”Source: docs.snowflake.com
5.Copy parameters that prevent and catch data handling errors
Most data handling errors in a COPY load come from a mismatch between the file and the table, and most are fixed with a parameter rather than by editing the file. COPY INTO <table> takes two kinds of parameters. File format options describe how to parse the bytes, such as TRIM_SPACE, NULL_IF, STRIP_NULL_VALUES and ERROR_ON_COLUMN_COUNT_MISMATCH. Copy options decide what the load does with what it parsed, such as MATCH_BY_COLUMN_NAME, ENFORCE_LENGTH, INCLUDE_METADATA and PURGE. Three further options act after parsing. ON_ERROR sets what happens when a row or file fails: continue, skip the file, or abort the statement. FORCE loads all files regardless of whether they were loaded before, which can duplicate data. LOAD_UNCERTAIN_FILES loads files whose load status can no longer be determined. The parameters below decide how many rows reach that point at all.
VALIDATION_MODE is a dry run. With RETURN_<n>_ROWS, RETURN_ERRORS or RETURN_ALL_ERRORS, the statement checks the staged files and reports what it found instead of loading anything. Run it against a new partner's first delivery before the real load, so a malformed date column shows up as a list of errors rather than a half-populated table. It is a bulk-loading tool for standard tables, and one reason to run a one-off COPY on a warehouse before handing a location to a pipe. It also has a limit worth remembering: it can't be combined with MATCH_BY_COLUMN_NAME in the same statement.
Over-length strings either fail or shrink. ENFORCE_LENGTH defaults to TRUE, so a 12-character product code arriving for a VARCHAR(10) column makes the COPY statement produce an error. Set it to FALSE and Snowflake truncates the string to the column length. TRUNCATECOLUMNS does the same job with the opposite logic and exists for compatibility with other databases; use one or the other. Truncation keeps the load running but changes the data, so choose it only where a cut-off value is still correct, such as a free-text comment field, and never for keys.
MATCH_BY_COLUMN_NAME loads JSON, Avro, ORC, Parquet and CSV by column name, so column order in the file stops mattering. Its failure mode is quiet. File columns with no matching table column are not loaded. Table columns with no match in the file receive NULL, so they must allow NULL. And if not a single column matches, which happens when an upstream system renames everything to camelCase while the load uses CASE_SENSITIVE, the load still succeeds and inserts a row of NULLs for every record. The option also can't be used together with a SELECT transformation in the same COPY; trying it is a compilation error, so reorder-and-cast loads and match-by-name loads are separate designs.
INCLUDE_METADATA writes METADATA$ values such as METADATA$FILENAME or METADATA$START_SCAN_TIME into columns of the target table, which is how a table records which file each row came from. It only works with MATCH_BY_COLUMN_NAME, and the target column must already exist; Snowflake doesn't add it. For CSV, set ERROR_ON_COLUMN_COUNT_MISMATCH = FALSE, because the extra metadata column otherwise makes the column counts disagree.
Some errors are really parsing problems. A CSV exporter that writes a space before each opening quote makes Snowflake read the space as the start of the field, so the quotes become part of the string; TRIM_SPACE removes those spaces during the load. In JSON loaded into a VARIANT column, a "null" value is stored as a string rather than SQL NULL, and STRIP_NULL_VALUES = TRUE drops those values when they only mean "missing", saving storage and query time. Once a load succeeds, PURGE = TRUE removes the data files from their original location, which keeps the stage small.
COPY INTO mytable
FROM @%mytable
FILE_FORMAT = (TYPE = CSV TRIM_SPACE=true FIELD_OPTIONALLY_ENCLOSED_BY = '0x22');Checkpoint 8 of 8· Match them up
Match each COPY parameter to the data handling problem it addresses.
Tap a term, then the definition that fits it.
VALIDATION_MODE validates instead of loading, ENFORCE_LENGTH = FALSE truncates rather than errors, INCLUDE_METADATA maps METADATA$ fields to columns, and TRIM_SPACE strips unwanted spaces while parsing.
“If FALSE, the strings are automatically truncated to the target column length.”Source: docs.snowflake.com
Sources
(8)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“You cannot access data held in archival cloud storage classes that requires restoration before it can be retrieved.”
↩︎ Data at rest, data in motion, and where files must be“The best solution may depend upon the volume of data to load and the frequency of loading.”
↩︎ Data at rest, data in motion, and where files must be“Bulk loading relies on user-provided virtual warehouses, which are specified in the COPY statement.”
↩︎ Bulk COPY versus Snowpipe for files“can fail over to a storage location in another region or on another cloud provider”
↩︎ Rows in motion: Snowpipe Streaming, CDC, OLTP and API sources“The best solution may depend upon the volume of data to load and the frequency of loading.”
↩︎ Key concept - 2.
“Automated loading, with S3 event notifications delivered through Amazon SQS, Amazon SNS, or Amazon EventBridge”
↩︎ Bulk COPY versus Snowpipe for files“To change it, you recreate the pipe, which drops its load metadata.”
↩︎ Bulk COPY versus Snowpipe for files“Each pipe keeps load metadata, which is a record of the files that it processed in the last 14 days”
↩︎ Bulk COPY versus Snowpipe for files“Neither Snowpipe nor bulk loading can join, aggregate, or filter rows during a load.”
↩︎ Bulk COPY versus Snowpipe for files“A pipe reads from an internal stage, or from an external stage that typically accesses cloud storage through a storage integration.”
↩︎ Bulk COPY versus Snowpipe for files“Your source is a database or SaaS application rather than files. Use an Openflow connector to ingest the data directly from the source system.”
↩︎ Rows in motion: Snowpipe Streaming, CDC, OLTP and API sources“The same pipe syntax works for standard tables, Snowflake-managed Iceberg tables, and externally managed Iceberg tables.”
↩︎ Querying in place: external tables and Iceberg tables“Bulk loading also lets you reload files with FORCE and, for standard tables, use VALIDATION_MODE to check files for errors before you load them.”
↩︎ Copy parameters that prevent and catch data handling errors“With automated loading, a new pipe loads only the files that arrive after you set up event notifications.”
↩︎ Exam trap 1“With automated loading, a new pipe loads only the files that arrive after you set up event notifications.”
↩︎ Prediction - 3.
“Snowflake treats the path value as a prefix and performs a prefix match against the file name in the external location.”
↩︎ Bulk COPY versus Snowpipe for files“Boolean that specifies to load all files, regardless of whether they were loaded previously”
↩︎ Copy parameters that prevent and catch data handling errors“MATCH_BY_COLUMN_NAME can’t be used with the VALIDATION_MODE parameter in a COPY statement”
↩︎ Copy parameters that prevent and catch data handling errors“If TRUE, the COPY statement produces an error if a loaded string exceeds the target column length.”
↩︎ Copy parameters that prevent and catch data handling errors“If no match is found, a set of NULL values for each record in the files is loaded into the table.”
↩︎ Copy parameters that prevent and catch data handling errors“These two options can still be used separately, but can’t be used together.”
↩︎ Copy parameters that prevent and catch data handling errors“This copy option can only be used with the MATCH_BY_COLUMN_NAME copy option.”
↩︎ Copy parameters that prevent and catch data handling errors“When you load a CSV file with INCLUDE_METADATA, set the file format option ERROR_ON_COLUMN_COUNT_MISMATCH to FALSE.”
↩︎ Copy parameters that prevent and catch data handling errors“Doing so tells Snowflake to automatically remove the data files from the original location after the data is loaded successfully.”
↩︎ Copy parameters that prevent and catch data handling errors“These two options can still be used separately, but can’t be used together.”
↩︎ Exam trap 3“If FALSE, the strings are automatically truncated to the target column length.”
↩︎ Checkpoint - 4.https://docs.snowflake.com/en/user-guide/snowpipe-streaming/data-load-snowpipe-streaming-overviewOfficial docs
“Use Named Channels when reading from a source that requires strict ordering semantics, such as Kafka partitions or Change Data Capture (CDC).”
↩︎ Rows in motion: Snowpipe Streaming, CDC, OLTP and API sources“Use Snowpipe Streaming when data arrives as rows from applications, devices, or services and you need low-latency data availability.”
↩︎ Rows in motion: Snowpipe Streaming, CDC, OLTP and API sources“Named Channels provide ordered, exactly-once ingestion within each channel by using offset tokens.”
↩︎ Checkpoint“stream rows directly from devices, applications, and services into Snowflake tables or Snowflake-managed Apache Iceberg tables”
↩︎ Checkpoint - 5.
“defines partition columns in a new external table as expressions that parse the path or filename information stored in the METADATA$FILENAME pseudocolumn”
↩︎ Querying in place: external tables and Iceberg tables“External tables are read-only.”
↩︎ Exam trap 2 - 6.
“An Iceberg table that uses an external catalog provides limited Snowflake platform support.”
↩︎ Querying in place: external tables and Iceberg tables - 7.
“An external volume provides Snowflake with access to your cloud storage location, while a catalog integration connects Snowflake to your external Iceberg catalog.”
↩︎ Querying in place: external tables and Iceberg tables - 8.
“Use the TRIM_SPACE file format option to remove undesirable spaces during the data load.”
↩︎ Copy parameters that prevent and catch data handling errors