You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- OpenLineage defines a [column-level lineage facet]- (https://github.com/OpenLineage/OpenLineage/blob/ff0d87d30ed6c9fe39472788948266a6d3190585/spec/facets/ColumnLineageDatasetFacet.md).
18
+
- OpenLineage defines a [column-level lineage facet]- (https://github.com/OpenLineage/OpenLineage/blob/main/spec/facets/ColumnLineageDatasetFacet.json).
19
19
- Marquez has a lineage endpoint `GET /api/v1/lineage` that returns the current lineage graph connected to a job or a dataset
20
20
21
+
### Column lineage characteristics and general assumptions
22
+
23
+
Column level lineage is a different lineage graph due to a different node granularity - kind of zoomed-in view of existing lineage. Instead of datasets and jobs being lineage graph nodes, each dataset field becomes a node. Additionally, there are edges between dataset fields, instead of datasets itself. Thus, enriching existing lineage with column lineage information would not be sufficient. That’s why we propose another API endpoint with column lineage graph.
24
+
25
+
Upstream and downstream edges do have different characteristics. An output dataset is always produced by a single version of input dataset (one upstream), while a single input datset version can have multiple output dataset versions. Lineage graph can be then easily flooded by downstream subgraph which blurs the overall view. That's why we consider an upstream column lineage as a default one. Downstream lineage will be returned only when requested explicitly.
26
+
21
27
### New Elements
22
-
We propose to add the following:
23
-
- Add column lineage to the lineage endpoint
24
-
- A new column-lineage endpoint leveraging the column lineage facet to retrieve lineage for a given column.
25
-
- Point-in-time upstream (dataset or column level) lineage given a version of a dataset.
28
+
29
+
We propose the following changes:
30
+
31
+
- Add column lineage to the dataset resource endpoint. Column lineage will NOT be added to existing `/lineage` endpoint as it may be a heavy database operation run on each lineage graph's node which we want to avoid. Based on that, column level lineage get be requested per dataset in separate requests when required.
32
+
- A new column-lineage endpoint leveraging the column lineage facet to retrieve lineage for a given column.
33
+
- Point-in-time upstream (dataset or column level) lineage given a version of a dataset.
26
34
27
35
## Proposal
28
36
29
-
### add column lineage to existing endpoint
30
-
In the GET /lineage api, add column lineage to DATASET nodes' data
# Input fields, present within "inEdges", can be also returned within a graph due to a `depth` parameter greate than 0.
100
95
}
101
96
]
102
97
}
103
98
```
104
99
100
+
The `depth` parameter controls how many edges, from a given dataset field, shall be returned. The default is set to `0`. In case of default equal `1`, each `inputField` will be returned as a separate node within a response graph with `inputFields` used to produce it. Please note that extending depth may increase the graph size and affect request performance.
101
+
102
+
The endpoints above fetches upstream column-lineage for given dataset field or all fields within a dataset. Downstream column lineage is turned off by default. However, this can be turned on with an extra `withDownstream` parameter like:
103
+
104
+
```
105
+
GET /column-lineage?nodeId=datasetField:food_delivery:public.delivery_7_days:a&withDownstream=true
106
+
107
+
```
108
+
This will include `outEdges` within the returned node of the graph.
109
+
110
+
105
111
### Point in time upstream lineage
106
-
return historical upstream lineage from a given Dataset version.
107
-
This adds the version element to the nodeId in both the existing `/api/v1/lineage` and newly proposed `/api/v1/column-lineage` endpoint
112
+
113
+
Point in time lineage for newly proposed `/api/v1/column-lineage` endpoint:
108
114
```
109
-
GET /lineage?nodeId=dataset:food_delivery:public.delivery_7_days:{version}
110
-
GET /column-lineage?nodeId=dataset:food_delivery:public.delivery_7_days:{version}&column=a
115
+
GET /column-lineage?nodeId=dataset_field:food_delivery:public.delivery_7_days:a&datasetVersion=123e4567-e89b-12d3-a456-426614174000
116
+
GET /column-lineage?nodeId=dataset_field:food_delivery:public.delivery_7_days:a&lineageAt=1661846242
111
117
```
112
-
This returns only upstream lineage in this current proposal. This is because upstream lineage is well defined to a specific version while downstream lineage is not. The data payload would add a version field.
118
+
119
+
Point in time can be controlled by:
120
+
***datasetVersion** - uuid of a specific dataset version,
121
+
***lineageAt** - which contains a unix timestamp.
122
+
123
+
When **lineageAt** specified, the latest dataset version before timestamp will be found. Regardles **datasetVersion** or **lineageAt** parameters applied, responses will be the same as below:
Adding the columnLineage facet requires a formatting of existing facet data.
139
+
### columne lineage facet in dataset resource endpoint
140
+
Adding the columnLineage facet requires a formatting of existing facet data (work in progress).
135
141
### column lineage endpoint
136
142
The `/column-lineage` endpoint leverages the `/lineage` endpoint and then filters down the payload to return the expected result.
137
143
### point-in-time upstream lineage
144
+
138
145
The point-in-time upstream lineage leverages the run to dataset version relation to track back the lineage of a given dataset of job version.
139
146
Dataset version -> run that produced it -> consumed Dataset Versions.
140
147
141
148
## Next Steps
142
149
143
-
Review of this proposal and production of detailed design for the implementation, in particular for the point in time lineage which might affect the dabtabase schema.
150
+
Review of this proposal and production of detailed design for the implementation.:
0 commit comments