From 69168e7b73e32415b67ad3f099480f7b525ed33b Mon Sep 17 00:00:00 2001 From: Kaarthik Andavar Date: Wed, 11 Oct 2023 18:00:09 +1300 Subject: [PATCH] Bug/dynamic table alter on column syntax (#790) * bug/Dynamic-table-comment-on-syntax * Add changelog * Fix relation type * Fix alter * Update dynamic table comment alter statement * update comment on syntax --------- Co-authored-by: Pat Kearns Co-authored-by: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Co-authored-by: colin-rogers-dbt <111200756+colin-rogers-dbt@users.noreply.github.com> --- .changes/unreleased/Fixes-20231002-144648.yaml | 6 ++++++ dbt/include/snowflake/macros/adapters.sql | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixes-20231002-144648.yaml diff --git a/.changes/unreleased/Fixes-20231002-144648.yaml b/.changes/unreleased/Fixes-20231002-144648.yaml new file mode 100644 index 000000000..6acb28c8a --- /dev/null +++ b/.changes/unreleased/Fixes-20231002-144648.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fix the alter syntax on column for dynamic table +time: 2023-10-02T14:46:48.980242+13:00 +custom: + Author: kaarthik108 + Issue: "769" diff --git a/dbt/include/snowflake/macros/adapters.sql b/dbt/include/snowflake/macros/adapters.sql index 024c05274..b2b496356 100644 --- a/dbt/include/snowflake/macros/adapters.sql +++ b/dbt/include/snowflake/macros/adapters.sql @@ -183,7 +183,7 @@ {% macro snowflake__alter_column_comment(relation, column_dict) -%} {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute="name") | list %} {% if relation.is_dynamic_table -%} - {% set relation_type = "dynamic table" %} + {% set relation_type = "table" %} {% else -%} {% set relation_type = relation.type %} {% endif %}