From 6f96705b197fdc7b495e33b3cd9908aa095513b7 Mon Sep 17 00:00:00 2001 From: Dan Parent <65294587+dparent1@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:09:02 -0400 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 a3daf7266..355ddab15 100644 --- a/dbt/adapters/spark/impl.py +++ b/dbt/adapters/spark/impl.py @@ -186,6 +186,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 @@ -194,7 +195,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,