nutritious-bird-77396
10/07/2020, 10:52 PMDatasetSnapshot
metadata…..
I am having some issues when Deserializing the fields-> type-> type
within the SchemaMetadata
Aspect….
https://github.com/linkedin/datahub/blob/master/metadata-models/src/main/pegasus/com/linkedin/schema/SchemaFieldDataType.pdl
I guess i should set the type of data as value in my Jackson Deserialization inorder for me to set the corresponding type but i am having challenges with that…
If linkedin or anyone in the community handled such case with Jackson Deserialization kindly help out….
Details of input/error in the Thread
nutritious-bird-77396
10/07/2020, 10:52 PMSchemaMetadata
aspect….
{
"urn": {
"dataPlatformUrn": {
"platformName": "streamPlatform"
},
"datasetName": "clickstream",
"fabricType": "TEST"
},
"aspects": [
{
"schemaMetadata": {
"schemaName": "hbaseEvent",
"platform": "urn:li:dataPlatform:hbase",
"version": 0,
"created": {
"time": 0,
"actor": "urn:li:corpuser:jdoe"
},
"lastModified": {
"time": 0,
"actor": "urn:li:corpuser:jdoe"
},
"hash": "",
"platformSchema": {
"kafkaSchema": {
"documentSchema": "{\"type\":\"record\",\"name\":\"MetadataChangeEvent\",\"namespace\":\"com.linkedin.mxe\",\"doc\":\"Kafka event for proposing a metadata change for an entity.\",\"fields\":[{\"name\":\"auditHeader\",\"type\":{\"type\":\"record\",\"name\":\"KafkaAuditHeader\",\"namespace\":\"com.linkedin.avro2pegasus.events\",\"doc\":\"Header\"}}]}"
}
},
"fields": [
{
"fieldPath": "hbase",
"description": "Bar",
"nativeDataType": "string",
"type": {
"type": {
"stringType": ""
}
}
}
],
"primaryKeys": [
"key1",
"key2",
"key3"
],
"foreignKeysSpecs": {
"key1": {
"foreignKey": {
"urnForeignKey": {
"currentFieldPath": "/datalake/dataset"
}
}
},
"key2": {
"foreignKey": {
"urnForeignKey": {
"currentFieldPath": "/datalake/datasets2"
}
}
}
}
}
}
]
}
nutritious-bird-77396
10/07/2020, 10:54 PMfields->type
is not set….
Exception - com.linkedin.data.avro.DataTranslationException: Error processing /proposedSnapshot/com.linkedin.metadata.snapshot.DatasetSnapshot/aspects/0/com.linkedin.schema.SchemaMetadata/fields/0/type
ERROR :: /proposedSnapshot/com.linkedin.metadata.snapshot.DatasetSnapshot/aspects/0/com.linkedin.schema.SchemaMetadata/fields/0/type :: required field is absent
nutritious-bird-77396
10/07/2020, 10:56 PMSchemaFieldDataType
and based on the name it would go to the corresponding datatype…
/**
* JsonSchemaFieldDataTypeType
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT, property = "@type")
@JsonSubTypes({
@JsonSubTypes.Type(value = JsonBooleanType.class, name = "booleanType"),
@JsonSubTypes.Type(value = JsonFixedType.class, name = "fixedType"),
@JsonSubTypes.Type(value = JsonStringType.class, name = "stringType"),
@JsonSubTypes.Type(value = JsonBytesType.class, name = "bytesType"),
@JsonSubTypes.Type(value = JsonNumberType.class, name = "numberType"),
@JsonSubTypes.Type(value = JsonEnumType.class, name = "enumType"),
@JsonSubTypes.Type(value = JsonNullType.class, name = "nullType"),
@JsonSubTypes.Type(value = JsonMapType.class, name = "mapType"),
@JsonSubTypes.Type(value = JsonArrayType.class, name = "arrayType"),
@JsonSubTypes.Type(value = JsonUnionType.class, name = "unionType"),
@JsonSubTypes.Type(value = JsonRecordType.class, name = "recordType")
}
)
public interface JsonSchemaFieldDataTypeType {
}
bumpy-keyboard-50565
10/08/2020, 11:42 AMnutritious-bird-77396
10/08/2020, 3:06 PMbumpy-keyboard-50565
10/08/2020, 3:07 PMacceptable-architect-70237
10/08/2020, 6:15 PMnutritious-bird-77396
10/08/2020, 9:57 PMbumpy-keyboard-50565
10/09/2020, 1:43 PMbumpy-keyboard-50565
10/09/2020, 1:43 PMacceptable-architect-70237
10/09/2020, 3:35 PMbumpy-keyboard-50565
10/09/2020, 5:31 PMnutritious-bird-77396
10/09/2020, 7:03 PMbumpy-keyboard-50565
10/09/2020, 7:14 PMbumpy-keyboard-50565
10/09/2020, 7:14 PMbumpy-keyboard-50565
10/09/2020, 7:15 PMnutritious-bird-77396
10/09/2020, 7:29 PM{
"urn": "urn:li:dataset:(urn:li:dataPlatform:streamPlatform,clickstream,TEST)",
"aspects": [
{
"com.linkedin.common.Ownership": {
"owners": [
{
"owner": "urn:li:corpuser:johndoe",
"type": "DEVELOPER",
"source": {
"type": "MANUAL",
"url": ""
}
}
],
"lastModified": {
"actor": "urn:li:corpuser:johndoe",
"impersonator": "urn:li:corpuser:alice",
"time": 1597269355
}
}
}
]
}
bumpy-keyboard-50565
10/10/2020, 12:55 AMPegasus-compatible JSON (API) => Data Template => Generic Record (Kafka) => Data Template (MCE consumer)
, why not just Avro JSON (API) => Generic Record (Kafka) => Data Template (MCE consumer)
?nutritious-bird-77396
10/10/2020, 7:55 PMAvro JSON (API) => Generic Record (Kafka)
?bumpy-keyboard-50565
10/10/2020, 8:19 PMnutritious-bird-77396
10/11/2020, 2:18 PM