Skip to content

Commit 720ed1b

Browse files
authored
Ele 5120 fusion databricks bugfix (#867)
* make_temp_relation: create view in the same schema for fusion databricks * stop running tests on dbt 1.8.0 since they won't work anymore * Update make_temp_relation.sql
1 parent 57a8101 commit 720ed1b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/test-all-warehouses.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ jobs:
5151
dremio,
5252
]
5353
include:
54-
# If we're not running on a specific dbt version, then always add postgres on 1.8.0
55-
- dbt-version: "${{ inputs.dbt-version || '1.8.0' }}"
56-
warehouse-type: postgres
5754
- dbt-version: "${{ inputs.dbt-version || 'latest_pre' }}"
5855
warehouse-type: postgres
5956
- dbt-version: "${{ inputs.dbt-version || 'fusion' }}"

macros/utils/table_operations/make_temp_relation.sql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818

1919
{% macro databricks__edr_make_temp_relation(base_relation, suffix) %}
2020
{% set tmp_identifier = elementary.table_name_with_suffix(base_relation.identifier, suffix) %}
21-
{% set tmp_relation = api.Relation.create(identifier=tmp_identifier, type='view') %}
21+
{% if elementary.is_dbt_fusion() %}
22+
{# In dbt-fusion, the view will be created as non-temporary. Therefore, we need the relation to include database and schema.
23+
So we use the same ones as the original relation and just change the identifier. #}
24+
{% set tmp_relation = base_relation.incorporate(path={"identifier": tmp_identifier}, type='view') %}
25+
{% else %}
26+
{% set tmp_relation = api.Relation.create(identifier=tmp_identifier, type='view') %}
27+
{% endif %}
2228
{% do return(tmp_relation) %}
2329
{% endmacro %}
2430

0 commit comments

Comments
 (0)