Skip to content

Commit

Permalink
initital attempt at modifying get_alter_materialized_view_as_sql
Browse files Browse the repository at this point in the history
  • Loading branch information
McKnight-42 committed Sep 22, 2023
1 parent 377414c commit d219af2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions dbt/include/bigquery/macros/relations/materialized_view/alter.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
) %}

{% if configuration_changes.requires_full_refresh %}
{{ get_replace_sql(existing_relation, relation, sql) }}
{% else %}

{{ bigquery__get_replace_materialized_view_as_sql(relation, sql) }}
{%- set auto_refresh = configuration_changes.auto_refresh -%}
{%- if auto_refresh -%}{{- log('Applying UPDATE AUTOREFRESH to: ' ~ relation) -}}{%- endif -%}

{% else %}
alter materialized view {{ relation }}
set options (
{% if auto_refresh %}enable_refresh = {{ auto_refresh.context }}{% endif %}
)

{%- endif %}


{% endmacro %}
Expand Down

0 comments on commit d219af2

Please sign in to comment.