Stages, File Formats & Cloud Storage Integration
Read a clear definition, compare the concepts, then try the SQL or client command. Detailed explanations and diagrams remain available when you need them.
Before you begin
Intermediate · 15 lessons · About 315 minutes including detailed reading.
Prerequisite: Advanced SQL & Transactions. Reading needs no account. Manual SQL practice requires an authorized Snowflake account, suitable role and warehouse. Commands are examples, not executed by this website.
Start with the internal-stage path and the supplied orders.csv; cloud storage is not needed for those lessons. For external stages, choose one provider and arrange administrator help for cloud IAM and account-level integration privileges. Replace every placeholder. The last lab checks an allowed read and a blocked path; this website provisions nothing.
Begin Module 05 →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.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- 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.
- 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. - 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.
Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →
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.
What this module covers
- Internal stages: user, table, and named stages; external stages.
- External storage: AWS S3, Azure Blob, GCS, and S3-compatible storage.
- File formats: CSV, JSON, Parquet, Avro, ORC, XML, and compression options.
- Stage operations: PUT, GET, LIST, and REMOVE.
- Storage Integration purpose and credential-based access comparison.
- Integration lifecycle: CREATE/ALTER/DROP STORAGE INTEGRATION, DESC INTEGRATION, and SHOW INTEGRATIONS.
- Properties: STORAGE_PROVIDER, ENABLED, STORAGE_ALLOWED_LOCATIONS, and STORAGE_BLOCKED_LOCATIONS.
- AWS IAM role, external ID, Snowflake identity, and trust relationship.
- GCS service account and Azure tenant/service principal setup.
- Stage access using USAGE ON INTEGRATION, scoped storage permissions, and allowed/blocked paths.
- Cross-cloud access considerations, secure unloading setup, and access-denied troubleshooting.
- Lab: Configure an external stage through a storage integration and validate access.
Your lesson path
- Lesson 1 · About 18 min
From a file to a table: understand the journey
A file holds source bytes, a stage locates files, and a table holds loaded rows.
Read and practise → - Lesson 2 · About 20 min
Internal and external stages: choose the location
Use a user stage for personal files, a table stage for a table-related workflow, or a named stage for a reusable managed location.
Read and practise → - Lesson 3 · About 25 min
Read CSV correctly: delimiters, headers and quotes
CSV parsing needs an agreed delimiter, header and quote rule; a filename alone is not enough.
Read and practise → - Lesson 4 · About 22 min
Missing amounts, zero and data types
An empty field, the text NULL and a numeric zero carry different meanings until the file format interprets them.
Read and practise → - Lesson 5 · About 25 min
Create a named stage, upload a file and find it
Create the empty location, upload the local file, then list the file entries.
Read and practise → - Lesson 6 · About 25 min
Preview the file and explain every output column
Preview the parsed fields before loading rows into a table.
Read and practise → - Lesson 7 · About 20 min
Download and remove staged files
GET downloads files from an internal stage to your client machine. REMOVE deletes staged files. Neither command is a table-row operation.
Read and practise → - Lesson 8 · About 20 min
Choose a file format and compression contract
A file format describes how bytes become records. File structure and compression are different choices: CSV can be compressed, and a .gz suffix alone does not tell you the record layout.
Read and practise → - Lesson 9 · About 20 min
Storage integrations and the two permission systems
A storage integration is an account-level Snowflake object used to access approved external storage through a cloud identity. Cloud permissions and Snowflake privileges must both allow the operation.
Read and practise → - Lesson 10 · About 20 min
AWS S3: role permissions and trust
An S3 integration uses an AWS IAM role. The role’s permission policy says what it may access; its trust policy says who may assume it.
Read and practise → - Lesson 11 · About 20 min
Google Cloud Storage: grant the generated identity
A GCS integration identifies a Snowflake-managed service account. Your cloud administrator grants that identity access to the chosen bucket.
Read and practise → - Lesson 12 · About 20 min
Azure Blob: tenant consent and storage access
An Azure integration uses a service principal in your tenant. Tenant consent enables the identity relationship; a storage role assignment then authorizes access to blobs.
Read and practise → - Lesson 13 · About 20 min
Grant access, change configuration and retire an integration
Integration lifecycle management means controlling who can use it, changing settings deliberately and removing dependencies before retirement.
Read and practise → - Lesson 14 · About 20 min
Cross-cloud access, S3-compatible endpoints and exports
The storage provider and Snowflake account location are separate choices. Supported access paths still need a deliberate plan for endpoints, transfer cost, data location and write permissions.
Read and practise → - Lesson 15 · About 20 min
Lab: prove allowed access and reject an excluded path
Complete one provider setup, create a stage, then check both a permitted read and an excluded location. A trustworthy setup must demonstrate its boundary as well as its successful path.
Read and practise →