Configure an external volume for Iceberg tables

This topic provides information to help you configure an external volume for Iceberg tables. Before you can create an Iceberg table, you must have an external volume.

Create an external volume

You can create and configure an external volume to use with one or more Iceberg tables.

For specific instructions, see the following topics:

Enable versioning for your external cloud storage

Iceberg table data is stored in external cloud storage that you manage. If the data is in a central data repository (or data lake) that is operated on by multiple tools and services, accidental deletion or corruption might occur.

To support object recovery, you can enable versioning for your external cloud storage.

Active storage location

Each external volume supports a single active storage location. If you specify multiple storage locations when you create an external volume, Snowflake assigns one location as the active location. The active location remains the same for the lifetime of the external volume.

Assignment occurs when the first table that uses the external volume is created. Snowflake uses the following logic to choose an active location:

  • If the STORAGE_LOCATIONS list contains one or more local storage locations, Snowflake uses the first local storage location in the list. A local storage location is with the same cloud provider and in the same region as your Snowflake account.

  • If the STORAGE_LOCATIONS list does not contain any local storage locations, Snowflake selects the first location in the list.

Note

  • Cross-cloud/cross-region Iceberg tables are supported only when you use an external Iceberg catalog. For more information, see Cross-cloud/cross-region support.

  • External volumes that were created before Snowflake version 7.44 might have used a different logic to select an active location.

Set an external volume at the account, database, or schema level

To define which existing external volume to use for Iceberg tables, you can set the EXTERNAL_VOLUME parameter at the following levels:

Account:

Account administrators can use the ALTER ACCOUNT command to set the parameter for the account. If the value is set for the account, all Iceberg tables created in the account read from and write to this external volume by default.

Object:

Users can execute the appropriate CREATE <object> or ALTER <object> command to override the EXTERNAL_VOLUME parameter value at the database or schema level. The lowest-scoped declaration is used: schema > database > account.

In addition to the minimum privileges required to modify an object using the appropriate ALTER <object_type> command, a role must have the USAGE privilege on the external volume.

Example

The following statement sets an external volume (my_s3_vol) for a database named my_database_1:

ALTER DATABASE my_database_1
  SET EXTERNAL_VOLUME = 'my_s3_vol';
Copy

After setting an external volume at the database level, you can create an Iceberg table in that database without specifying an external volume. The following statement creates an Iceberg table in my_database_1 that uses Snowflake as the catalog and uses the default external volume (my_s3_vol) set for the database.

CREATE ICEBERG TABLE iceberg_reviews_table (
  id STRING,
  product_name STRING,
  product_id STRING,
  reviewer_name STRING,
  review_date DATE,
  review STRING
)
CATALOG = 'SNOWFLAKE'
BASE_LOCATION = 'my/product_reviews/';
Copy