From 3d6d5bdb0c604d3994c56d96f304213377618b92 Mon Sep 17 00:00:00 2001 From: Dan Parent <65294587+dparent1@users.noreply.github.com> Date: Sat, 19 Nov 2022 22:09:49 +0000 Subject: [PATCH] Setting _schema rather than replacing it [CT-276] Apache Iceberg Support #294 The _schema variable was used for non-iceberg tables but was being overridden by work for iceberg v2 tables. I've made it so the iceberg condition will set _schema rather than blanket changing the schema for all providers. --- dbt/adapters/spark/impl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbt/adapters/spark/impl.py b/dbt/adapters/spark/impl.py index 4655d710a..962a26f1e 100644 --- a/dbt/adapters/spark/impl.py +++ b/dbt/adapters/spark/impl.py @@ -187,6 +187,7 @@ def list_relations_without_caching( if try_show_tables: _, name, _ = row information = self.use_show_tables(name) + _schema = schema_relation.schema else: _schema, name, _, information = row is_delta = "Provider: delta" in information @@ -195,7 +196,7 @@ def list_relations_without_caching( rel_type = RelationType.View if "Type: VIEW" in information else RelationType.Table relation = self.Relation.create( - schema=schema_relation.schema, + schema=_schema, identifier=name, type=rel_type, information=information,