From 543d2ce97de0a7e3cd8d66ff6da24e7948ae3ac7 Mon Sep 17 00:00:00 2001 From: Rohit Date: Mon, 30 Sep 2024 13:44:17 -0700 Subject: [PATCH] Keep string FQN as a way to add lineage information (#32585) --- .../main/java/org/apache/beam/sdk/metrics/Lineage.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/metrics/Lineage.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/metrics/Lineage.java index ab64389fe198..65ec12af0580 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/metrics/Lineage.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/metrics/Lineage.java @@ -112,7 +112,7 @@ public static String getFqName(String system, Iterable segments) { * Add a FQN (fully-qualified name) to Lineage. Segments will be processed via {@link #getFqName}. */ public void add(String system, @Nullable String subtype, Iterable segments) { - metric.add(getFqName(system, subtype, segments)); + add(getFqName(system, subtype, segments)); } /** @@ -122,6 +122,14 @@ public void add(String system, Iterable segments) { add(system, null, segments); } + /** + * Adds the given details as Lineage. For asset level lineage the resource location should be + * specified as Dataplex FQN https://cloud.google.com/data-catalog/docs/fully-qualified-names + */ + public void add(String details) { + metric.add(details); + } + /** Query {@link StringSet} metrics from {@link MetricResults}. */ public static Set query(MetricResults results, Type type) { MetricsFilter filter =