From cbfda4eb1719210d7a38eb259e67a041bccfae78 Mon Sep 17 00:00:00 2001 From: datalytics1 <32775384+datalytics1@users.noreply.github.com> Date: Tue, 14 Dec 2021 09:22:15 -0300 Subject: [PATCH 1/3] Update adapters.sql --- dbt/include/athena/macros/adapters.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/include/athena/macros/adapters.sql b/dbt/include/athena/macros/adapters.sql index a02bb339..f6b31c85 100644 --- a/dbt/include/athena/macros/adapters.sql +++ b/dbt/include/athena/macros/adapters.sql @@ -110,7 +110,7 @@ {% endmacro %} {% macro athena__drop_relation(relation) -%} - {% if config.get('incremental_strategy') == 'insert_overwrite' %} + {% if config.get('incremental_strategy') != 'append' %} {%- do adapter.clean_up_table(relation.schema, relation.table) -%} {% endif %} {% call statement('drop_relation', auto_begin=False) -%} From 8aad2db8d886428b65e3091c58d80abad3bd15c5 Mon Sep 17 00:00:00 2001 From: datalytics1 <32775384+datalytics1@users.noreply.github.com> Date: Tue, 14 Dec 2021 09:35:25 -0300 Subject: [PATCH 2/3] Update adapters.sql --- dbt/include/athena/macros/adapters.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dbt/include/athena/macros/adapters.sql b/dbt/include/athena/macros/adapters.sql index f6b31c85..cd78d741 100644 --- a/dbt/include/athena/macros/adapters.sql +++ b/dbt/include/athena/macros/adapters.sql @@ -110,9 +110,7 @@ {% endmacro %} {% macro athena__drop_relation(relation) -%} - {% if config.get('incremental_strategy') != 'append' %} - {%- do adapter.clean_up_table(relation.schema, relation.table) -%} - {% endif %} + {%- do adapter.clean_up_table(relation.schema, relation.table) -%} {% call statement('drop_relation', auto_begin=False) -%} drop {{ relation.type }} if exists {{ relation }} {%- endcall %} From 7db718f0898ac6c908b31b516240b23d108c92f5 Mon Sep 17 00:00:00 2001 From: datalytics1 <32775384+datalytics1@users.noreply.github.com> Date: Tue, 14 Dec 2021 09:40:57 -0300 Subject: [PATCH 3/3] Update adapters.sql --- dbt/include/athena/macros/adapters.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbt/include/athena/macros/adapters.sql b/dbt/include/athena/macros/adapters.sql index cd78d741..f1a3ef5a 100644 --- a/dbt/include/athena/macros/adapters.sql +++ b/dbt/include/athena/macros/adapters.sql @@ -110,7 +110,9 @@ {% endmacro %} {% macro athena__drop_relation(relation) -%} + {% if config.get('incremental_strategy') != 'append' %} {%- do adapter.clean_up_table(relation.schema, relation.table) -%} + {% endif %} {% call statement('drop_relation', auto_begin=False) -%} drop {{ relation.type }} if exists {{ relation }} {%- endcall %}