|
33 | 33 | import marquez.common.models.RunId; |
34 | 34 | import marquez.db.JobDao; |
35 | 35 | import marquez.db.LineageDao; |
36 | | -import marquez.db.LineageDao.DatasetSummary; |
37 | | -import marquez.db.LineageDao.JobSummary; |
38 | | -import marquez.db.LineageDao.RunSummary; |
39 | 36 | import marquez.db.RunDao; |
40 | 37 | import marquez.db.models.JobRow; |
41 | 38 | import marquez.service.DelegatingDaos.DelegatingLineageDao; |
42 | | -import marquez.service.LineageService.UpstreamRunLineage; |
43 | 39 | import marquez.service.models.DatasetData; |
44 | 40 | import marquez.service.models.Edge; |
45 | 41 | import marquez.service.models.Graph; |
@@ -356,11 +352,15 @@ public Lineage directLineage(NodeId nodeId, int depth) { |
356 | 352 | if (ds == null) { |
357 | 353 | continue; |
358 | 354 | } |
359 | | - // IMPORTANT: Use the string values |
360 | | - Optional<UUID> maybeJob = getJobFromInputOrOutput( |
361 | | - ds.getName().getValue(), |
362 | | - ds.getNamespace().getValue()); |
363 | | - maybeJob.ifPresent(nextJobs::add); |
| 355 | + // Only follow upstream/downstream direction based on whether the dataset |
| 356 | + // is an input or output |
| 357 | + if (jd.getInputUuids().contains(dsUuid)) { |
| 358 | + // IMPORTANT: Use the string values |
| 359 | + Optional<UUID> maybeJob = getJobFromInputOrOutput( |
| 360 | + ds.getName().getValue(), |
| 361 | + ds.getNamespace().getValue()); |
| 362 | + maybeJob.ifPresent(nextJobs::add); |
| 363 | + } |
364 | 364 | } |
365 | 365 | } |
366 | 366 |
|
|
0 commit comments