diff --git a/metadata-ingestion/src/datahub/ingestion/source/aws/glue.py b/metadata-ingestion/src/datahub/ingestion/source/aws/glue.py index 43506838d9..05a063a915 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/aws/glue.py +++ b/metadata-ingestion/src/datahub/ingestion/source/aws/glue.py @@ -555,6 +555,23 @@ class GlueSource(Source): nullable=True, ) fields.append(schema_field) + + partition_keys = table["PartitionKeys"] + for partition_key in partition_keys: + schema_field = SchemaField( + fieldPath=partition_key["Name"], + nativeDataType=partition_key["Type"], + type=get_column_type( + glue_source, + partition_key["Type"], + table_name, + partition_key["Name"], + ), + recursive=False, + nullable=False, + ) + fields.append(schema_field) + return SchemaMetadata( schemaName=table_name, version=0, diff --git a/metadata-ingestion/tests/unit/glue/glue_mces_golden.json b/metadata-ingestion/tests/unit/glue/glue_mces_golden.json index 508d4a9e62..3c48429aea 100644 --- a/metadata-ingestion/tests/unit/glue/glue_mces_golden.json +++ b/metadata-ingestion/tests/unit/glue/glue_mces_golden.json @@ -192,6 +192,22 @@ "globalTags": null, "glossaryTerms": null, "isPartOfKey": false + }, + { + "fieldPath": "year", + "jsonPath": null, + "nullable": false, + "description": null, + "type": { + "type": { + "com.linkedin.pegasus2avro.schema.StringType": {} + } + }, + "nativeDataType": "string", + "recursive": false, + "globalTags": null, + "glossaryTerms": null, + "isPartOfKey": false } ], "primaryKeys": null, @@ -458,6 +474,22 @@ "globalTags": null, "glossaryTerms": null, "isPartOfKey": false + }, + { + "fieldPath": "year", + "jsonPath": null, + "nullable": false, + "description": null, + "type": { + "type": { + "com.linkedin.pegasus2avro.schema.StringType": {} + } + }, + "nativeDataType": "string", + "recursive": false, + "globalTags": null, + "glossaryTerms": null, + "isPartOfKey": false } ], "primaryKeys": null,