witty-keyboard-20400
10/01/2021, 11:09 AM{
"auditHeader": null,
"proposedSnapshot": {
"com.linkedin.pegasus2avro.metadata.snapshot.CorpUserSnapshot": {
"urn": "urn:li:corpuser:datahub",
"aspects": [
{
"com.linkedin.pegasus2avro.identity.CorpUserInfo": {
"active": true,
"displayName": {
"string": "Data Hub"
},
"email": "<mailto:datahub@linkedin.com|datahub@linkedin.com>",
"title": {
"string": "CEO"
},
"fullName": {
"string": "Data Hub"
},
}
}
]
}
},
"proposedDelta": null
},
CorpUserKey
(with a field username
) is the Key Aspect for the entity CorpUserSnapshot
(as in the definition of CorpUserSnapshot.pdl). But I don't see any username
field and value in this JSON element.
Could anyone help me understand this anomaly?
@mammoth-bear-12532 @big-carpet-38439witty-keyboard-20400
10/01/2021, 11:42 AMmetadata-utils/src/main/java/com/linkedin/metadata/utils/EntityKeyUtils.java
@Nonnull
public static Urn getUrnFromLog(MetadataChangeLog metadataChangeLog) {
if (metadataChangeLog.hasEntityUrn() && metadataChangeLog.hasEntityKeyAspect()) {
throw new IllegalArgumentException("Urn and keyAspect cannot both be set");
}
...
}
Is this the reason key aspect (CorpUserKey) is not present as urn "urn:li:corpuser:datahub"
is already set?witty-keyboard-20400
10/01/2021, 11:49 AMif (metadataChangeLog.hasEntityKeyAspect()) {
throw new UnsupportedOperationException("Identifying entity with key aspect is not yet supported");
}
Is Entity instance ID based on key aspect not supported yet?
I checked the call hierarchy for getUrnFromLog() method, and found it's called only from:
com.linkedin.metadata.kafka.MetadataChangeLogProcessor#consume
..which is not called from anywhere!
I think I'm missing something basic here. Could anyone please help here to clear my doubt?big-carpet-38439
10/01/2021, 3:40 PMbig-carpet-38439
10/01/2021, 3:43 PMcom.linkedin.metadata.kafka.MetadataChangeLogProcessor#consume
is invoked when a Kafka event on the MetadataChangeLog topic is handled by the service. But thanks for catching this, we actually should be supporting identifying the entity with the key aspect alone. The idea is that someone producing metadata can either provide the key aspect object or the urnwitty-keyboard-20400
10/02/2021, 2:49 AMname
and corpUserKey
aspect are both required.
@Entity = {
"name": "corpuser",
"keyAspect": "corpUserKey"
}
record CorpUserSnapshot {
urn: CorpuserUrn
aspects: array[CorpUserAspect]
}
Now, within the CorpUserSnapshot JSON instance, it doesn't seem correct to say that mention of only a URN "urn": "urn:li:corpuser:datahub"
covers for both the CorpUserSnapshot --> urn
field and corpUserKey
aspect. OR, is that correct actually?
I'm confused how to utilize the metadata model with proper understanding and precision. If I declare a new entity along with its key aspect, would the fields of key aspect be optional to mention in the instance of the entity?