Skip to content

Commit

Permalink
Lisätty vacuum full siivousskriptiin
Browse files Browse the repository at this point in the history
  • Loading branch information
Matz Rasmus committed Oct 28, 2024
1 parent 2b8c5d4 commit a29fe30
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dbt/macros/helpers/tempdata_cleanup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
{% do run_query(sql) %}
{% set sql = 'delete from stg.stg_'+table+' where dw_metadata_dbt_copied_at < (select start_time from raw.completed_dbt_runs where raw_table = \''+table+'\')' %}
{% do run_query(sql) %}
{% set sql = 'vacuum full raw.'+table %}
{% do run_query(sql) %}
{% set sql = 'vacuum full stg.stg_'+table %}
{% do run_query(sql) %}
{{ print ('Completed cleaning table '+table) }}
{{ print (--------------------------------------------------------------) }}
{% endfor %}
{% endif %}
{%- endmacro %}

0 comments on commit a29fe30

Please sign in to comment.