Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. Stages, COPY INTO and Snowpipe

Snowflake, BigQuery & Databricks · Snowflake

Stages, COPY INTO and Snowpipe

Mediumwarehouses-08
snowflakecopy-intosnowpipestagesingestion

Question

How do you load data into Snowflake, and how is Snowpipe different from COPY INTO?

Solution

A stage is a location Snowflake loads from or unloads to. COPY INTO is the batch command that loads staged files into a table, using a warehouse that you choose. Snowpipe is the continuous version, which loads files automatically soon after they arrive, using Snowflake-managed compute.

Stages

  • Internal stages: storage inside Snowflake (a user stage, a table stage, or a named stage).
  • External stages: point to your own bucket in S3, GCS or Azure Blob.

COPY INTO

COPY INTO orders
FROM @orders_stage/2025/03/01/
FILE_FORMAT = (TYPE = PARQUET)
MATCH_BY_COLUMN_NAME = CASE_INSENSITIVE;

You run it from a scheduled job or a task. It uses the warehouse you are in, so you control the size and the cost. Snowflake remembers which files it has loaded into a table, for 64 days, and skips them if you run the command again. That makes reruns safe within that window. After 64 days, the history is gone, so an old file could be loaded twice unless you use the FORCE option deliberately or track files yourself.

Snowpipe

A pipe wraps a COPY INTO statement. When a file lands in the bucket, a cloud event notification (such as S3 events through SQS) tells Snowflake, and Snowflake loads the file with serverless compute, typically within a minute or so. You pay for the compute used plus a small per-file overhead, so thousands of tiny files are wasteful. Aim for files around 100 to 250 MB compressed when you can.

Snowpipe Streaming

For very low latency, Snowpipe Streaming writes rows directly into tables through an SDK or the Kafka connector, with no files in between. Latency is a few seconds. Use it for event streams that need to be fresh.

Choosing

Daily or hourly batch loads with a known schedule: COPY INTO on a warehouse you already run. Files arriving unpredictably and needing quick loads: Snowpipe. Row-level events from Kafka that need seconds of latency: Snowpipe Streaming.

PreviousNext