FANNG1 commented on code in PR #7397:
URL: https://github.com/apache/gravitino/pull/7397#discussion_r2152101173


##########
lineage/src/main/java/org/apache/gravitino/lineage/Utils.java:
##########
@@ -35,4 +38,58 @@ public static String getJobName(RunEvent event) {
     Job job = event.getJob();
     return job == null ? "Unknown" : job.getName().toString();
   }
+
+  public static OpenLineage.RunEvent mapLineageServertoClientRunEvent(
+      io.openlineage.server.OpenLineage.RunEvent serverEvent) {
+    OpenLineage ol = new OpenLineage(serverEvent.getSchemaURL());
+
+    return ol.newRunEventBuilder()
+        
.eventType(OpenLineage.RunEvent.EventType.valueOf(serverEvent.getEventType().name()))
+        .eventTime(serverEvent.getEventTime())
+        .run(toClientRun(serverEvent.getRun(), ol))
+        .job(toClientJob(serverEvent.getJob(), ol))
+        .inputs(toClientInputs(serverEvent.getInputs(), ol))
+        .outputs(toClientOutputs(serverEvent.getOutputs(), ol))
+        .build();
+  }
+
+  private static OpenLineage.Run toClientRun(
+      io.openlineage.server.OpenLineage.Run serverRun, OpenLineage ol) {
+    return ol.newRun(serverRun.getRunId(), ol.newRunFacetsBuilder().build());
+  }
+
+  private static OpenLineage.Job toClientJob(
+      io.openlineage.server.OpenLineage.Job serverJob, OpenLineage ol) {
+    return ol.newJobBuilder()
+        .namespace(serverJob.getNamespace())
+        .name(serverJob.getName())
+        .facets(ol.newJobFacetsBuilder().build())

Review Comment:
   seems the facets are not copies from ol?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to