From fa5f89e41d657bc3c0ae931ba565fca1cdeb611f Mon Sep 17 00:00:00 2001 From: Jelmer Kuperus Date: Fri, 4 Oct 2024 20:38:52 +0200 Subject: [PATCH] Fix for: https://github.com/databricks/dbt-databricks/issues/819 (#820) Co-authored-by: Ben Cassell <98852248+benc-db@users.noreply.github.com> --- CHANGELOG.md | 3 ++- dbt/include/databricks/macros/materializations/snapshot.sql | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df65df75..ce1b1339 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ ### 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)) +- 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) +- Don't define table properties on snapshot staging views (thanks @jelmerk!) ([820](https://github.com/databricks/dbt-databricks/pull/820)) ## dbt-databricks 1.8.6 (September 18, 2024) diff --git a/dbt/include/databricks/macros/materializations/snapshot.sql b/dbt/include/databricks/macros/materializations/snapshot.sql index c1b8055c..3d1236a1 100644 --- a/dbt/include/databricks/macros/materializations/snapshot.sql +++ b/dbt/include/databricks/macros/materializations/snapshot.sql @@ -10,7 +10,9 @@ {# needs to be a non-temp view so that its columns can be ascertained via `describe` #} {% call statement('build_snapshot_staging_relation') %} - {{ create_view_as(tmp_relation, select) }} + create or replace view {{ tmp_relation }} + as + {{ select }} {% endcall %} {% do return(tmp_relation) %}