Object reference · Lesson 3 of 8Detailed study · about 12 min

File formats and stages

A file format tells Snowflake how to interpret a file. A stage identifies where files are stored. You often use them together when loading data.

Understand the idea

A file is a sequence of bytes. A CSV reader needs rules to turn those bytes into fields and rows. A named file format lets several loads reuse the same parsing contract instead of repeating settings in every command.

Key ideas in simple English
ConceptWhat it means
File formatParsing rules such as CSV delimiter and header handling.
Internal stageA Snowflake-managed location for files.
External stageA reference to a cloud storage location with configured access.

A concrete example

Northstar receives orders.csv with a header and comma-separated values. The stage answers where it is; the file format answers how to read it.

Remember: Creating a stage or file format does not upload a file or load a table.

Explain it step by step · full theory

Understand the idea

A file is a sequence of bytes. A CSV reader needs rules to turn those bytes into fields and rows. A named file format lets several loads reuse the same parsing contract instead of repeating settings in every command.

An internal stage holds files managed within Snowflake. An external stage references storage outside Snowflake and requires cloud access configuration. Neither kind is the same as the destination table. Files must still be read or loaded deliberately.

Follow the example

The example creates a CSV format that skips one header row and an empty internal stage that uses it. The stage needs a separate upload before LIST can show a file. We do not upload anything from this website.

If the input file has no header, SKIP_HEADER = 1 would skip a real data row. If a quoted field contains a comma, quote-handling settings matter. Match the file format to a real sample rather than assuming every CSV follows the same contract.

The fresh stage is empty. No ORDERS rows change, and no file is created by this SQL.

Words used in this lesson
File format
Parsing rules such as CSV delimiter and header handling.
Internal stage
A Snowflake-managed location for files.
External stage
A reference to a cloud storage location with configured access.

See how it works

Choose a step to explore the idea at your own pace.

Open the interactive explanation
Interactive explainer1 / 3

File formats and stages

Northstar sales team
Business requirement

Start with the requirement

Northstar receives orders.csv with a header and comma-separated values. The stage answers where it is; the file format answers how to read it.

Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.

Read the complete diagram explanation
  1. Start with the requirement

    Northstar receives orders.csv with a header and comma-separated values. The stage answers where it is; the file format answers how to read it.

  2. Choose the objects

    Compare the responsibilities: File format: Parsing rules such as CSV delimiter and header handling.; Internal stage: A Snowflake-managed location for files.; External stage: A reference to a cloud storage location with configured access.

  3. Explain the outcome

    Creating a stage or file format does not upload a file or load a table.

Try the SQL or command

Read → predict → run in your learning environment → compare. You can also learn by reading without an account.

New to SQL? Where to run it and how to read it

A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.

  1. No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
  2. For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
  3. Read the entire example, including comments beginning with --. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor.
  4. Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
SELECT / FROM
Choose the values to return / identify their input.
VALUES / COLUMN1
VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
AS / WITH
AS gives a result a readable name. WITH names a temporary query step within one statement.
NULL / ::
NULL means missing or unknown. The :: notation converts a value to a named data type.
Session
One connection and its settings. Keep related transaction steps in the same session.
Database.schema.table
A full address for stored data. It is separate from the warehouse that processes queries.
Help with common practice errors
  • No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
  • Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
  • Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
  • Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.

Before running this lesson

Examples are for reading first. Optional execution requires an authorized learning account, a selected warehouse for queries, and privileges on the named objects. Nothing runs on this website.

Read the example

SQL · example
CREATE FILE FORMAT L2_OBJECTS_LAB.SALES.ORDERS_CSV
TYPE = CSV SKIP_HEADER = 1 FIELD_OPTIONALLY_ENCLOSED_BY = '"';
CREATE STAGE L2_OBJECTS_LAB.SALES.ORDER_FILES
FILE_FORMAT = L2_OBJECTS_LAB.SALES.ORDERS_CSV;
LIST @L2_OBJECTS_LAB.SALES.ORDER_FILES;

What to expect and why

The fresh stage is empty. No ORDERS rows change, and no file is created by this SQL.

Check your understanding

Choose an answer, then check your reasoning. This is practice, not a scored test.

Which object explains how to split a CSV row into fields?

Try it yourself

A colleague creates a stage and expects the ORDERS table to contain new rows. Explain the missing steps.

Compare your reasoning

The file must be placed in the stage or referenced storage, then read or loaded with a command such as COPY INTO. The file format supplies parsing rules; creating the stage alone moves no rows.

Official sources and curriculum

Object reference · See module scope