External Tables & Iceberg: Multi-Cloud Data Access
Master Snowflake external tables with Iceberg format for multi-cloud data lakes.
20+ years shipping high-throughput database systems. Lessons pulled from things that broke in production.
- ✓Basic SQL knowledge (SELECT, WHERE, GROUP BY).
- ✓Familiarity with Snowflake concepts (warehouses, stages, storage integrations).
- ✓Access to a cloud storage bucket (S3, Azure Blob, GCS) with Iceberg tables.
- External tables let you query data stored outside Snowflake (e.g., S3, Azure Blob) without loading it.
- Iceberg is an open table format that supports ACID transactions and schema evolution on object storage.
- Snowflake's Iceberg integration allows you to create external tables on Iceberg tables, enabling multi-cloud access.
- You can query Iceberg external tables using standard SQL, and Snowflake handles partitioning and metadata.
- Best for sharing data across clouds or with other engines like Spark, Trino, or Athena.
Imagine you have a giant filing cabinet (data lake) in a cloud storage. Normally, you'd have to bring files into your office (Snowflake) to read them. External tables let you read files directly from the cabinet without moving them. Iceberg is like a smart index card system that keeps track of which files are part of which table, even if they're in different cabinets across different offices (clouds). Snowflake can read those index cards and give you the data as if it were in your own office.
In modern data architectures, data often resides in multi-cloud data lakes (AWS S3, Azure Blob, GCS). Snowflake's external tables allow you to query that data directly without loading it into Snowflake storage. With the rise of open table formats like Apache Iceberg, you can now combine the flexibility of Iceberg's ACID transactions and schema evolution with Snowflake's powerful query engine. This tutorial dives deep into creating and querying Snowflake external tables on Iceberg tables, covering multi-cloud access patterns, production debugging, and best practices. You'll learn how to set up external tables, handle partitioning, and avoid common pitfalls. By the end, you'll be able to build a cross-cloud data lake that can be queried by Snowflake, Spark, Trino, and more.
What are External Tables in Snowflake?
External tables in Snowflake allow you to query data stored in external cloud storage (AWS S3, Azure Blob, GCS) as if it were a regular table. The data remains in the external location, and Snowflake reads it on the fly. This is useful for data lakes where you want to avoid data movement. External tables are read-only and support partitioning, file formats like Parquet, ORC, CSV, JSON, and now Apache Iceberg. They are defined using a storage integration and a file format. For Iceberg, Snowflake can read the Iceberg metadata to understand the table schema, partitions, and snapshots.
Setting Up an Iceberg Table in Snowflake
Snowflake can also create and manage Iceberg tables directly (Snowflake-managed Iceberg tables). This allows you to use Snowflake's compute to write Iceberg tables that can be read by other engines. To create an Iceberg table, you need an external volume (a storage location) and specify the Iceberg table format. Here's how to create a Snowflake-managed Iceberg table and then query it via an external table (or directly).
Multi-Cloud Data Access with Iceberg
One of the biggest advantages of Iceberg is that it is cloud-agnostic. You can have an Iceberg table stored in AWS S3, and query it from Snowflake running on Azure, or from Spark on GCP. Snowflake's external tables can read Iceberg tables from any cloud storage, as long as network access is configured. This enables multi-cloud data lakes. For example, you might have data produced in AWS, processed in Azure, and consumed in GCP. With Iceberg, all engines see the same consistent snapshot. To set up multi-cloud access, you need to create storage integrations for each cloud provider and point the external table to the Iceberg metadata location. Snowflake will read the metadata and data files from the remote cloud.
Partitioning and Clustering in Iceberg External Tables
Iceberg tables support partitioning (by a column, e.g., date) and clustering (sorting within partitions). Snowflake's external tables can leverage Iceberg's partition metadata to prune partitions during queries. This is critical for performance. When you create an external table on an Iceberg table, Snowflake reads the partition spec from the Iceberg metadata. You don't need to specify PARTITION BY in the external table definition. However, to get the best performance, ensure your queries filter on partition columns. You can also use clustering keys in the Iceberg table to further optimize scans.
Schema Evolution and Time Travel
Iceberg supports schema evolution: you can add, drop, or rename columns without rewriting data. Snowflake external tables on Iceberg automatically detect schema changes after a REFRESH. However, the external table definition must be updated if you want to query new columns. You can use ALTER EXTERNAL TABLE ... ADD COLUMN to add columns. Iceberg also supports time travel: you can query a specific snapshot ID or timestamp. Snowflake external tables do not directly support time travel; you need to use the Iceberg table's snapshot metadata. For Snowflake-managed Iceberg tables, you can use AT (TIMESTAMP => ...) syntax.
Performance Optimization and Best Practices
To get the best performance from Iceberg external tables, follow these practices: 1) Use partitioning and clustering in the Iceberg table. 2) Filter on partition columns. 3) Use column pruning (select only needed columns). 4) Consider materialized views if queries are repeated. 5) Monitor query profiles for full scans. 6) Use AUTO_REFRESH or scheduled tasks to keep metadata fresh. 7) For large tables, consider using Snowflake's search optimization service (not available for external tables yet). 8) Use the Iceberg REST catalog integration for better metadata management.
The Case of the Vanishing Partitions
- External tables on Iceberg do not auto-refresh by default; you must refresh metadata to see new partitions.
- Use Snowflake tasks to periodically refresh external tables in production.
- Consider using Snowflake's Iceberg catalog integration for automatic metadata refresh.
- Monitor query results for stale data; set up alerts when row counts drop unexpectedly.
- Always test with a REFRESH after adding new data to the Iceberg table.
ALTER EXTERNAL TABLE my_ext_table REFRESH;SELECT COUNT(*) FROM my_ext_table;| File | Command / Code | Purpose |
|---|---|---|
| create_external_table.sql | CREATE STORAGE INTEGRATION my_s3_int | What are External Tables in Snowflake? |
| create_iceberg_table.sql | CREATE OR REPLACE EXTERNAL VOLUME my_iceberg_vol | Setting Up an Iceberg Table in Snowflake |
| multi_cloud_query.sql | CREATE STORAGE INTEGRATION aws_s3_int | Multi-Cloud Data Access with Iceberg |
| partition_pruning.sql | SELECT * FROM my_iceberg_ext_table WHERE dt = '2025-01-01'; | Partitioning and Clustering in Iceberg External Tables |
| schema_evolution.sql | ALTER EXTERNAL TABLE my_iceberg_ext_table REFRESH; | Schema Evolution and Time Travel |
| optimization.sql | CREATE MATERIALIZED VIEW mv_iceberg AS | Performance Optimization and Best Practices |
Key takeaways
Common mistakes to avoid
3 patternsForgetting to refresh the external table after adding new data.
Assuming external tables support time travel.
Not using partition columns in WHERE clauses, causing full table scans.
Interview Questions on This Topic
What is the difference between a Snowflake external table and a regular table?
Frequently Asked Questions
20+ years shipping high-throughput database systems. Lessons pulled from things that broke in production.
That's Snowflake. Mark it forged?
3 min read · try the examples if you haven't