Skip to content

Commit 8a8b21f

Browse files
committed
Fix temp tables cleanup
Currently for some reason we have some temp test tables and dbt_models__tmp_
1 parent 8572db5 commit 8a8b21f

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

macros/edr/system/system_utils/clean_dbt_columns_temp_tables.sql

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
{% macro clean_elementary_temp_tables() %}
2-
{% do elementary.clean_elementary_test_tables() %}
2+
{% do elementary.edr_log("Deleting dbt_columns temp tables") %}
3+
{% set elementary_database, elementary_schema = elementary.get_package_database_and_schema() %}
4+
{% set dbt_columns_temp_tables_relations = dbt_utils.get_relations_by_pattern(schema_pattern=elementary_schema, table_pattern='%tmp%', database=elementary_database) %}
5+
{% for temp_relation in dbt_columns_temp_tables_relations %}
6+
{% do elementary.edr_log("Deleting temp table - " ~ temp_relation) %}
7+
{% do adapter.drop_relation(temp_relation) %}
8+
{% endfor %}
39
{% endmacro %}

macros/edr/tests/test_utils/clean_up_tables.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
{% for relation in relations %}
1111
{% do adapter.clean_up_table(relation) %}
1212
{% endfor %}
13-
{% endmacro %}
13+
{% endmacro %}

macros/utils/table_operations/fully_drop_relation.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
{% macro athena__fully_drop_relation(relation) %}
1010
{% do adapter.clean_up_table(relation) %}
1111
{% do adapter.drop_relation(relation) %}
12-
{% endmacro %}
12+
{% endmacro %}

macros/utils/table_operations/has_temp_table_support.sql

-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@
1717
{% macro athena__has_temp_table_support() %}
1818
{% do return(false) %}
1919
{% endmacro %}
20-

0 commit comments

Comments
 (0)