diff --git a/.changes/unreleased/Fixes-20230112-193406.yaml b/.changes/unreleased/Fixes-20230112-193406.yaml new file mode 100644 index 000000000..87d936128 --- /dev/null +++ b/.changes/unreleased/Fixes-20230112-193406.yaml @@ -0,0 +1,7 @@ +kind: Fixes +body: fix missing schema in catalog for delta tables +time: 2023-01-12T19:34:06.197611+02:00 +custom: + Author: hanna-liashchuk + Issue: "368" + PR: "589" diff --git a/dbt/adapters/spark/impl.py b/dbt/adapters/spark/impl.py index 2864c4f30..6e9493dc5 100644 --- a/dbt/adapters/spark/impl.py +++ b/dbt/adapters/spark/impl.py @@ -337,7 +337,10 @@ def parse_columns_from_information(self, relation: BaseRelation) -> List[SparkCo return columns def _get_columns_for_catalog(self, relation: BaseRelation) -> Iterable[Dict[str, Any]]: - columns = self.parse_columns_from_information(relation) + if relation.is_delta: + columns = self.get_columns_in_relation(relation) + else: + columns = self.parse_columns_from_information(relation) for column in columns: # convert SparkColumns into catalog dicts