Skip to content

Commit

Permalink
full refresh behaviour fix (#107)
Browse files Browse the repository at this point in the history
Co-authored-by: ilikutle <ilija.kutle@alligator-company.com>
  • Loading branch information
2 people authored and tglunde committed Oct 27, 2023
1 parent bc4491b commit 2c9f118
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dbt/include/exasol/macros/materializations/incremental.sql
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{% materialization incremental, adapter='exasol', supported_languages=['sql'] %}

{% set unique_key = config.get('unique_key') %}
{% set full_refresh_mode = flags.FULL_REFRESH %}
{%- set language = model['language'] -%}
{% set target_relation = this.incorporate(type='table') %}
{% set existing_relation = load_cached_relation(this) %}
{% set tmp_relation = make_temp_relation(this) %}
{% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}
{% set grant_config = config.get('grants') %}
{%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}


{{ run_hooks(pre_hooks, inside_transaction=False) }}

Expand All @@ -17,7 +18,7 @@
{% set to_drop = [] %}
{% if existing_relation is none %}
{% set build_sql = create_table_as(False, target_relation, sql) %}
{% elif existing_relation.is_view or full_refresh_mode %}
{% elif full_refresh_mode %}
{#-- Checking if backup relation exists#}
{% set backup_identifier = existing_relation.identifier ~ "__dbt_backup" %}
{% set backup_relation = existing_relation.incorporate(path={"identifier": backup_identifier}) %}
Expand Down

0 comments on commit 2c9f118

Please sign in to comment.