diff --git a/CHANGELOG.md b/CHANGELOG.md index 1255ed3..eda5216 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Add on_schema_change possibility - Fix table materialization for Delta models - Change GlueColumn parent from base Column to SparkColumn +- Fix get_columns_in_relation function to stop returning additional partition columns ## v1.8.1 - Fix typo in README.md diff --git a/dbt/adapters/glue/impl.py b/dbt/adapters/glue/impl.py index 0db6226..4475c04 100644 --- a/dbt/adapters/glue/impl.py +++ b/dbt/adapters/glue/impl.py @@ -268,6 +268,10 @@ def get_columns_in_relation(self, relation: BaseRelation): columns = [x for x in columns if x.name not in self.HUDI_METADATA_COLUMNS] + # strip partition columns. + columns = [x for x in columns + if not re.match(r'^Part \d+$', x.name)] + logger.debug("columns after strip:") logger.debug(columns)