-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉 Base Norrmalization: clean-up Redshift
tmp_schemas
after SAT (#14015
) Now after `base-normalization` SAT the Destination Redshift will be automatically cleaned up from test leftovers. Other destinations are not covered yet.
- Loading branch information
Showing
4 changed files
with
188 additions
and
5 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...te-integrations/bases/base-normalization/dbt-project-template/macros/clean_tmp_tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% macro clean_tmp_tables(schemas) -%} | ||
{{ adapter.dispatch('clean_tmp_tables')(schemas) }} | ||
{%- endmacro %} | ||
|
||
-- default | ||
{% macro default__clean_tmp_tables(schemas) -%} | ||
{% do exceptions.warn("\tINFO: CLEANING TEST LEFTOVERS IS NOT IMPLEMENTED FOR THIS DESTINATION. CONSIDER TO REMOVE TEST TABLES MANUALY.\n") %} | ||
{%- endmacro %} | ||
|
||
-- for redshift | ||
{% macro redshift__clean_tmp_tables(schemas) %} | ||
{%- for tmp_schema in schemas -%} | ||
{% do log("\tDROP SCHEMA IF EXISTS " ~ tmp_schema, info=True) %} | ||
{%- set drop_query -%} | ||
drop schema if exists {{ tmp_schema }} cascade; | ||
{%- endset -%} | ||
{%- do run_query(drop_query) -%} | ||
{%- endfor -%} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters