From 312f7c31f565c2610cc57d87a27d74aca74e60cb Mon Sep 17 00:00:00 2001 From: Anders Swanson Date: Thu, 28 Mar 2024 14:53:38 -0400 Subject: [PATCH] iceberg as config --- dbt/include/snowflake/macros/materializations/table.sql | 2 +- dbt/include/snowflake/macros/relations/table/create.sql | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dbt/include/snowflake/macros/materializations/table.sql b/dbt/include/snowflake/macros/materializations/table.sql index ef201c705..c15336acc 100644 --- a/dbt/include/snowflake/macros/materializations/table.sql +++ b/dbt/include/snowflake/macros/materializations/table.sql @@ -16,7 +16,7 @@ {#-- Drop the relation if it was a view to "convert" it in a table. This may lead to -- downtime, but it should be a relatively infrequent occurrence #} - {% if old_relation is not none and not old_relation.is_table %} + {% if old_relation is not none %} {{ log("Dropping relation " ~ old_relation ~ " because it is of type " ~ old_relation.type) }} {{ drop_relation_if_exists(old_relation) }} {% endif %} diff --git a/dbt/include/snowflake/macros/relations/table/create.sql b/dbt/include/snowflake/macros/relations/table/create.sql index c6bc8f775..660dc8ff7 100644 --- a/dbt/include/snowflake/macros/relations/table/create.sql +++ b/dbt/include/snowflake/macros/relations/table/create.sql @@ -1,10 +1,14 @@ {% macro snowflake__create_table_as(temporary, relation, compiled_code, language='sql') -%} + {{ log('XXX: am i here?', info=True) }} {%- set transient = config.get('transient', default=true) -%} + {%- set iceberg = config.get('iceberg', default=true) -%} {% if temporary -%} {%- set table_type = "temporary" -%} - {%- elif transient -%} - {%- set table_type = "transient" -%} + {# {%- elif transient -%} + {%- set table_type = "transient" -%} #} + {%- elif iceberg -%} + {%- set table_type = "iceberg" -%} {%- else -%} {%- set table_type = "" -%} {%- endif %}