From 285c53149d49bdb14c9351d86afc2cd54df52902 Mon Sep 17 00:00:00 2001 From: Takuya UESHIN Date: Thu, 3 Nov 2022 16:07:20 -0700 Subject: [PATCH 1/3] Partially revert to fix the case where schema config contains uppercase letters. --- dbt/adapters/databricks/impl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt/adapters/databricks/impl.py b/dbt/adapters/databricks/impl.py index 79426e537..2c1e1a533 100644 --- a/dbt/adapters/databricks/impl.py +++ b/dbt/adapters/databricks/impl.py @@ -131,13 +131,13 @@ def list_relations_without_caching( # type: ignore[override] f'Invalid value from "show table extended ...", ' f"got {len(row)} values, expected 4" ) - _, name, _, information = row + _schema, name, _, information = row rel_type = RelationType.View if "Type: VIEW" in information else RelationType.Table is_delta = "Provider: delta" in information is_hudi = "Provider: hudi" in information relation = self.Relation.create( database=schema_relation.database, - schema=schema_relation.schema, + schema=_schema, identifier=name, type=rel_type, information=information, From 5feb63a78788e81b9bf5c5509a23a914b638ecac Mon Sep 17 00:00:00 2001 From: Takuya UESHIN Date: Fri, 4 Nov 2022 14:08:54 -0700 Subject: [PATCH 2/3] comment --- dbt/adapters/databricks/impl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbt/adapters/databricks/impl.py b/dbt/adapters/databricks/impl.py index 2c1e1a533..62affa9ca 100644 --- a/dbt/adapters/databricks/impl.py +++ b/dbt/adapters/databricks/impl.py @@ -137,6 +137,8 @@ def list_relations_without_caching( # type: ignore[override] is_hudi = "Provider: hudi" in information relation = self.Relation.create( database=schema_relation.database, + # Use `_schema` retrieved from the cluster to avoid mismatched case + # between the profile and the cluster. schema=_schema, identifier=name, type=rel_type, From 76286dd6747841d99902598ad614cfe25105ba91 Mon Sep 17 00:00:00 2001 From: Takuya UESHIN Date: Fri, 4 Nov 2022 15:57:16 -0700 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 015f7d7f0..d32d14f9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Fixes - Fix copy into macro when passing `expression_list`. ([#223](https://github.com/databricks/dbt-databricks/pull/223)) +- Partially revert to fix the case where schema config contains uppercase letters. ([#224](https://github.com/databricks/dbt-databricks/pull/224)) ## dbt-databricks 1.3.1 (November 1, 2022)