diff --git a/wherehows-kafka/src/main/java/wherehows/processors/MetadataLineageProcessor.java b/wherehows-kafka/src/main/java/wherehows/processors/MetadataLineageProcessor.java index 8b28d1871c..1ab1c9387c 100644 --- a/wherehows-kafka/src/main/java/wherehows/processors/MetadataLineageProcessor.java +++ b/wherehows-kafka/src/main/java/wherehows/processors/MetadataLineageProcessor.java @@ -107,17 +107,17 @@ public class MetadataLineageProcessor extends KafkaMessageProcessor { * Get actor Urn string from app type or change audit stamp */ private String getActorUrn(MetadataLineageEvent event) { - // use app type first + // use actorUrn in ChangeAuditStamp first + ChangeAuditStamp auditStamp = event.changeAuditStamp; + if (auditStamp != null && auditStamp.actorUrn != null) { + return auditStamp.actorUrn.toString(); + } + + // use app type as fallback if (event.type != agent.UNUSED) { return "urn:li:multiProduct:" + event.type.name().toLowerCase(); } - - // if app type = UNUSED, use actorUrn in ChangeAuditStamp - ChangeAuditStamp auditStamp = event.changeAuditStamp; - if (auditStamp == null || auditStamp.actorUrn == null) { - throw new IllegalArgumentException("Requires ChangeAuditStamp actorUrn if MLE agent is UNUSED"); - } - return auditStamp.actorUrn.toString(); + throw new IllegalArgumentException("Require ChangeAuditStamp actorUrn"); } public FailedMetadataLineageEvent newFailedEvent(MetadataLineageEvent event, Throwable throwable) {