Skip to main content

Snowflake Horizon Catalog

Write Iceberg tables to Snowflake through Snowflake Horizon Catalog.

Supported features​

FeatureStatusRemarks
Read/write Snowflake-managed Iceberg tables✅Through Horizon's Iceberg REST catalog, without a Snowflake warehouse
Table descriptions in Snowflake✅
Column descriptions in Snowflake✅Comments set in Snowflake take precedence
Read native Snowflake tables❌️Only Iceberg tables are available through Horizon, see Make Iceberg the default table format
Read/write views❌️

Prerequisites​

  • A Snowflake database for Snowflake-managed Iceberg tables: with an external volume, or with Snowflake-managed storage.

Installation​

pip install 'dbt-polars[snowflake]'

Profile configuration​

Example​

my_project:
target: dev
outputs:
dev:
type: polars
catalog_type: snowflake
schema: dev
account: myorg-myaccount
database_name: analytics
role: transformer
credential: "{{ env_var('SNOWFLAKE_PAT') }}"

To combine this catalog with others, put the same parameters in an entry of catalogs, with type: snowflake and a name, see Catalog overview.

Parameter Reference​

The following parameters are supported, in addition to the common profile parameters:

  • catalog_type - (Required) Must be snowflake.

  • account - (Required) Account identifier in the form <organization>-<account>, as returned by SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME();.

  • database_name - (Required) Snowflake database holding the Iceberg tables.

  • schema - (Required) Default schema for models. dbt-polars creates missing schemas.

  • role - (Optional) Role dbt-polars acts as.

  • Authentication parameters - (Optional) Passed to pyiceberg's REST catalog, which exchanges them for an access token at Snowflake. Commonly used:

    • credential - Programmatic access token (PAT) of the user.
    • token - OAuth access token, e.g. from your identity provider.
    • scope - Overrides the session:role:<ROLE> scope derived from role.

Recommendations​

Run models in parallel​

For small models, most of the run time is spent waiting for Snowflake's REST API. We recommend threads: 4 with compute_threads: 1, so these calls run in parallel while one model at a time runs Polars. See Running models in parallel.

Make Iceberg the default table format​

dbt-polars can only read Iceberg tables. We recommend making Iceberg the default table format in Snowflake, so a plain CREATE TABLE also creates an Iceberg table:

ALTER DATABASE <database_name> SET DEFAULT_METADATA_WRITE_FORMAT = 'ICEBERG';

Required permissions​

The role dbt-polars uses needs these privileges:

PrivilegeOnNeeded for
USAGEthe databaseAccessing the database at all
CREATE SCHEMAthe databaseCreating schemas
USAGEthe external volumeCreating and writing tables
USAGE, CREATE ICEBERG TABLEschemas dbt-polars didn't createCreating tables in them
SELECTtables dbt-polars doesn't ownReading them, e.g. as a source
INSERT, UPDATE, DELETE, TRUNCATEtables dbt-polars doesn't ownWriting to them