Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop setting cluster by to None #806

Merged
merged 2 commits into from
Sep 25, 2024
Merged
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
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 -%}
Loading