Skip to content

snowflake_iceberg

etl_craft.dialects.warehouse.snowflake_iceberg

Snowflake warehouse, Iceberg tables.

SNOWFLAKE_MANAGED_VOLUME module-attribute

SNOWFLAKE_MANAGED_VOLUME = 'SNOWFLAKE_MANAGED'

The external volume that means Snowflake's own managed storage.

SNOWFLAKE_CATALOG module-attribute

SNOWFLAKE_CATALOG = 'SNOWFLAKE'

The catalog that means Snowflake manages the Iceberg metadata itself.

SnowflakeIcebergWarehouse

Bases: SnowflakeWarehouse

Snowflake, Iceberg tables: on Snowflake-managed storage unless a volume is named.

A task names its storage with the EXTERNAL_VOLUME and BASE_LOCATION parameters, since a team may point different targets at different volumes; cloning mirrors use the Cloning section's External_volume and Base_location. A task's CATALOG parameter names a catalog integration for a table in an externally managed Iceberg catalog; the default is Snowflake's own catalog. Whether Snowflake accepts writes to an external catalog depends on the integration.

row_id_generated

row_id_generated(conn: Connection, target: str) -> bool

Iceberg inserts supply computed keys under the target lock.

preserve_replacement_properties

preserve_replacement_properties(conn: Connection, target: str, candidate: str) -> None

Carry table comments; refuse customer storage and clustering before promotion.

backup_table

backup_table(conn: Connection, backup: str, target: str) -> None

Keep recovery rows in a native table, independent of an Iceberg base location.

create_table_as

create_table_as(conn: Connection, qualified_name: str, select_sql: str, params: Mapping[str, str]) -> None

Run CREATE ICEBERG TABLE, format version 2, on the task's volume or Snowflake's.

task_storage_problem

task_storage_problem(params: Mapping[str, str]) -> str | None

Check the task's storage parameters fit together.

A customer EXTERNAL_VOLUME needs BASE_LOCATION; Snowflake-managed storage needs neither. A CATALOG other than Snowflake's is a plain identifier and needs a customer volume, because an external catalog's data never lives in managed storage.

mirror_table_ddl

mirror_table_ddl(name: str, column_ddl: str, cloning: CloningConfig) -> str | None

Mirror into an Iceberg table on the volume the Cloning section names.

A mirror nothing else in the lakehouse could read would defeat its purpose, so both settings are required rather than falling back to an ordinary table.

cloning_storage_problem

cloning_storage_problem(cloning: CloningConfig) -> str | None

Require both External_volume and Base_location for Iceberg cloning mirrors.

alter_table_keyword

alter_table_keyword() -> str

Return ALTER ICEBERG TABLE: Snowflake refuses plain ALTER TABLE on an Iceberg table.

evolution_column_type

evolution_column_type(data_type: str) -> str

Iceberg strings have no bounds; native stages can report different VARCHAR limits.

audit_column_type

audit_column_type(column: str) -> str

Use TIMESTAMP_NTZ(6) for audit instants: Iceberg tables here take no zoned timestamp.

The engine writes only UTC instants, so storing them without a zone loses nothing.