From 636c62e76380323183495f59e74819cc13535be3 Mon Sep 17 00:00:00 2001 From: Pradeep Srikakolapu Date: Fri, 24 May 2024 05:59:04 -0700 Subject: [PATCH] Update replace.sql --- dbt/include/synapse/macros/adapters/replace.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbt/include/synapse/macros/adapters/replace.sql b/dbt/include/synapse/macros/adapters/replace.sql index ec7bedf..8b4addf 100644 --- a/dbt/include/synapse/macros/adapters/replace.sql +++ b/dbt/include/synapse/macros/adapters/replace.sql @@ -26,23 +26,23 @@ {{ get_create_intermediate_sql(target_relation, sql) }}; {{ get_create_backup_sql(existing_relation) }}; {{ get_rename_intermediate_sql(target_relation) }}; - {{ synapse__drop_relation(existing_relation) }} + {% do adapter.drop_relation(existing_relation) %} {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #} {%- elif target_relation.can_be_renamed -%} {{ get_create_intermediate_sql(target_relation, sql) }}; - {{ synapse__drop_relation(existing_relation) }}; + {% do adapter.drop_relation(existing_relation) %} {{ get_rename_intermediate_sql(target_relation) }} {# /* create target_relation in place by first backing up the existing relation */ #} {%- elif existing_relation.can_be_renamed -%} {{ get_create_backup_sql(existing_relation) }}; {{ get_create_sql(target_relation, sql) }}; - {{ synapse__drop_relation(existing_relation) }} + {% do adapter.drop_relation(existing_relation) %} {# /* no renaming is allowed, so just drop and create */ #} {%- else -%} - {{ synapse__drop_relation(existing_relation) }}; + {% do adapter.drop_relation(existing_relation) %} {{ get_create_sql(target_relation, sql) }} {%- endif -%}