Skip to main content

Querying from Snowflake

Currently, Snowflake supports Iceberg tables through External Tables and also Native Iceberg Tables.

Steps:​

These are high level steps to help you integrate Apache XTable™ (Incubating) synced Iceberg tables on Snowflake. For more additional information refer to the Getting started with Iceberg tables.

Create an external volume​

Iceberg tables on Snowflake uses user-supplied storage. The first step to create an Iceberg table is by creating an external volume in Snowflake to hold the Iceberg table data and metadata

sql
-- Create an External Volume to hold Parquet and Iceberg data
CREATE OR REPLACE EXTERNAL VOLUME <volume_name>
STORAGE_LOCATIONS =
(
(
NAME = <'my-s3-us-west-2'>
STORAGE_PROVIDER = 'S3'
STORAGE_BASE_URL = 's3://<bucket_name>/'
STORAGE_AWS_ROLE_ARN = 'arn:aws:iam::<accountId>:role/<roleName>'
)
);

Create a catalog integration for Iceberg files in object storage​

You can skip this step if you are using Snowflake as the catalog. You can also use AWS Glue as the catalog source.

sql
CREATE OR REPLACE CATALOG INTEGRATION <catalog_name>
CATALOG_SOURCE=OBJECT_STORE
TABLE_FORMAT=ICEBERG
ENABLED=TRUE;

Create an Iceberg table from Iceberg metadata in object storage​

Refer to additional examples in the Snowflake Create Iceberg Table guide for more information.

sql
CREATE ICEBERG TABLE myIcebergTable
EXTERNAL_VOLUME='<volume_name>'
CATALOG=<catalog_name>
METADATA_FILE_PATH='path/to/metadata/<VERSION>.metadata.json';

Once the table creation succeeds you can start using the Iceberg table as any other table in Snowflake.