Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit d2c6789

Browse files
committed
changing destination
Update incremental.sql
1 parent a219818 commit d2c6789

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Features
2+
body: allow changing the schema destination of tmp tables
3+
time: 2025-01-08T20:41:00.190868Z
4+
custom:
5+
Author: borjavb
6+
Issue: "1443"

dbt/include/bigquery/macros/materializations/incremental.sql

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,20 @@
7272
{% materialization incremental, adapter='bigquery', supported_languages=['sql', 'python'] -%}
7373

7474
{%- set unique_key = config.get('unique_key') -%}
75+
{%- set temp_schema = config.get('temp_schema') -%}
7576
{%- set full_refresh_mode = (should_full_refresh()) -%}
7677
{%- set language = model['language'] %}
7778

7879
{%- set target_relation = this %}
7980
{%- set existing_relation = load_relation(this) %}
80-
{%- set tmp_relation = make_temp_relation(this) %}
81+
{%- set temp_schema = config.get('temp_schema') -%}
82+
{%- if temp_schema is not none-%}
83+
{%- set temp_relation = this.incorporate(path={
84+
"schema": temp_schema
85+
}) -%}
86+
{%- do create_schema(temp_relation) -%}
87+
{% endif %}
88+
{%- set tmp_relation = make_temp_relation(temp_relation) %}
8189

8290
{#-- Validate early so we don't run SQL if the strategy is invalid --#}
8391
{% set strategy = dbt_bigquery_validate_get_incremental_strategy(config) -%}

0 commit comments

Comments
 (0)