Describe the bug
When Iceberg tables are enabled with custom materialization types, dbt is explicitly checking if materialization is of types 'incremental', 'table', or 'snapshot' and erroing out. This works without any issues in delta format.
Steps To Reproduce
- Create a custom materialization type.
- Use the custom materialization type in a dbt model with
table_format as iceberg.
- Run the dbt model.
Sample code
custom_table_materialization.sql
{% materialization custom_table_materialization, default %}
{%- set target_relation = api.Relation.create(database=database, identifier=model['alias'], schema=schema, type='table') -%}
{% set new_table_sql -%}
{{ sql }}
{%- endset %}
{%- call statement('source_table_creation') -%}
{{ dbt.create_table_as(False, target_relation, new_table_sql) }}
{%- endcall -%}
{{ return({'relations': [target_relation]}) }}
{%- endmaterialization %}
custom_mat_table.sql
{{
config({
"schema": var("core_silver_schema"),
"materialized": "custom_table_materialization",
"table_format": "iceberg",
"file_format": "delta"
})
}}
SELECT
1 AS dummy_column
dbt_project.yml
.....
flags:
use_managed_iceberg: true
.....
Expected behavior
dbt model with custom materialization of iceberg type runs without any errors.
Screenshots and log output
Runtime Error in model custom_mat_tables (models/custom_mat_table.sql)
When table_format is 'iceberg', materialized must be 'incremental', 'table', or 'snapshot'.
System information
The output of dbt --version:
Core:
- installed: 1.11.2
- latest: 1.11.2 - Up to date!
Plugins:
- databricks: 1.11.4 - Up to date!
- spark: 1.10.0 - Up to date!
The operating system you're using: macOS Tahoe: Version 26.2 (25C56)
The output of python --version: Python 3.12.11
Additional context
The problem appears to be a explicit check for these materializations in dbt create table macro. link
Describe the bug
When Iceberg tables are enabled with custom materialization types, dbt is explicitly checking if materialization is of types
'incremental', 'table', or 'snapshot'and erroing out. This works without any issues in delta format.Steps To Reproduce
table_formatasiceberg.Sample code
custom_table_materialization.sql
{% materialization custom_table_materialization, default %} {%- set target_relation = api.Relation.create(database=database, identifier=model['alias'], schema=schema, type='table') -%} {% set new_table_sql -%} {{ sql }} {%- endset %} {%- call statement('source_table_creation') -%} {{ dbt.create_table_as(False, target_relation, new_table_sql) }} {%- endcall -%} {{ return({'relations': [target_relation]}) }} {%- endmaterialization %}custom_mat_table.sql
{{ config({ "schema": var("core_silver_schema"), "materialized": "custom_table_materialization", "table_format": "iceberg", "file_format": "delta" }) }} SELECT 1 AS dummy_columndbt_project.yml
Expected behavior
dbt model with custom materialization of iceberg type runs without any errors.
Screenshots and log output
System information
The output of
dbt --version:The operating system you're using: macOS Tahoe: Version 26.2 (25C56)
The output of
python --version: Python 3.12.11Additional context
The problem appears to be a explicit check for these materializations in dbt create table macro. link