Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix PARTITION BY clause placement in CREATE ICEBERG TABLE DDL for Snowflake built-in catalog
time: 2026-03-06T16:30:35.728134-05:00
custom:
Author: jecolvin
Issue: "1720"
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ create or replace iceberg table {{ relation }}
{%- if contract_config.enforced %}
{{ get_table_columns_and_constraints() }}
{%- endif %}
{% if partition_by_string -%} partition by ({{ partition_by_string }}) {%- endif %}
{{ optional('external_volume', catalog_relation.external_volume, "'") }}
catalog = 'SNOWFLAKE' -- required, and always SNOWFLAKE for built-in Iceberg tables
base_location = '{{ catalog_relation.base_location }}'
{% if partition_by_string -%} partition by ({{ partition_by_string }}) {%- endif %}
{{ optional('storage_serialization_policy', catalog_relation.storage_serialization_policy, "'")}}
{{ optional('max_data_extension_time_in_days', catalog_relation.max_data_extension_time_in_days)}}
{{ optional('data_retention_time_in_days', catalog_relation.data_retention_time_in_days)}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ def test_partition_by_iceberg_builtin_catalog(self, project, setup_class):
run_dbt(["run"])
iceberg_sql = get_cleaned_model_ddl_from_file("builtin_table.sql")
assert "partition by (order_date)" in iceberg_sql
# partition by must appear before external_volume per Snowflake syntax
assert iceberg_sql.index("partition by") < iceberg_sql.index("external_volume")


class TestPartitionByIcebergRestCatalog(TestIcebergPartitionBy):
Expand Down
Loading