Skip to content

Commit

Permalink
Stop setting cluster by to None (#806)
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db authored Sep 25, 2024
1 parent 49b9c80 commit 44854db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## dbt-databricks TBD (TBD)
## dbt-databricks 1.8.7 (TBD)

### Fixes

- Stop setting cluster by to None. If you want to drop liquid clustering, you will need to full-refresh ([806]https://github.com/databricks/dbt-databricks/pull/806)

## dbt-databricks 1.8.6 (September 18, 2024)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@
{%- endmacro -%}

{% macro apply_liquid_clustered_cols(target_relation) -%}
{%- set file_format = config.get('file_format', default='delta') -%}
{%- set partition_by = config.get('partition_by', validator=validation.any[list, basestring], default=None) -%}
{%- set cols = config.get('liquid_clustered_by', validator=validation.any[list, basestring]) -%}
{%- if cols is not none %}
{%- if cols is string -%}
{%- set cols = [cols] -%}
{%- endif -%}
{%- endif -%}
{%- call statement('set_cluster_by_columns') -%}
ALTER {{ target_relation.type }} {{ target_relation }} CLUSTER BY ({{ cols | join(', ') }})
{%- endcall -%}
{%- elif not target_relation.is_hive_metastore() and file_format == "delta" and not partition_by -%}
{%- call statement('unset_cluster_by_columns') -%}
ALTER {{ target_relation.type }} {{ target_relation }} CLUSTER BY NONE
{%- endcall -%}
{%- endif %}
{%- endmacro -%}

0 comments on commit 44854db

Please sign in to comment.