Skip to content

Commit

Permalink
Refresh existing_relation in view materialization
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Jul 21, 2023
1 parent e7fc380 commit 7f3f656
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
-- cleanup
-- move the existing view out of the way
{% if existing_relation is not none %}
{{ adapter.rename_relation(existing_relation, backup_relation) }}
/* existing_relation might have existed at the beginning of this macro but doesn't now */
{% set existing_relation = load_cached_relation(existing_relation) %}
{ if existing_relation is not none %]
{{ adapter.rename_relation(existing_relation, backup_relation) }}
{% endif %}
{{ adapter.rename_relation(intermediate_relation, target_relation) }}

Expand Down

0 comments on commit 7f3f656

Please sign in to comment.