Skip to content

Commit 5893e5d

Browse files
committed
creating a view relation when creating a temp relation for databricks because dbt-databricks 1.10 now creates views only if the context of the model has langauge=sql but this macro also needs to run outside model context
1 parent 390ceb7 commit 5893e5d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

macros/utils/table_operations/make_temp_relation.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
{% endmacro %}
1818

1919
{% macro databricks__edr_make_temp_relation(base_relation, suffix) %}
20-
{% do return(dbt.make_temp_relation(base_relation, suffix)) %}
20+
{% set tmp_identifier = elementary.table_name_with_suffix(base_relation.identifier, suffix) %}
21+
{% set tmp_relation = api.Relation.create(identifier=tmp_identifier, type='view') %}
22+
{% do return(tmp_relation) %}
2123
{% endmacro %}
2224

2325
--- VIEWS

0 commit comments

Comments
 (0)