Table materialization is not using make_temp_relation
or alias
as identifier
#2340
Closed
1 of 5 tasks
Labels
bug
Something isn't working
good_first_issue
Straightforward + self-contained changes, good for new contributors!
stale
Issues that have gone stale
Describe the bug
Refering this particular file, it is present in new versions as well
https:/fishtown-analytics/dbt/blob/0.14.latest/core/dbt/include/global_project/macros/materializations/table/table.sql
The first 3 lines are, where for
tmp
andbackup
table,model['name']
is used instead ofmodel['identifier']
This results into failure while running the same model with different alias. Use usually do this to do backfilling, where our temporary tables are with alias
this.table ~ '_backfill'
. These model have same name as regular models but their aliases are different.Steps To Reproduce
this.table ~ '_backfill',
. Sample configExpected behavior
Both run should finish successfully as their aliases are different and they are working on to create different table in database.
Proposed solution
make_temp_relation
suffixes a timestamp with temp table name and that has solved this problem in our custom materializations. We are using something likeOR
Using this code to set the
tmp_identifier
would solve too. Although it is less resilient.Screenshots and log output
My model render failed with
System information
Which database are you using dbt with?
The output of
dbt --version
:I am running this in DBT Cloud (v0.14.4)
The operating system you're using:
MacOS Catalina v10.15.4
The output of
python --version
:Python 3.7.0
Additional context
Nope
The text was updated successfully, but these errors were encountered: