mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-02 03:39:03 +00:00
fix(ingest): add missing partition keys in schema for glue sources (#3238)
This commit is contained in:
parent
28cbb2b4ef
commit
903348e1db
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user