ambitious-bird-91607
01/24/2024, 9:54 AMGraphQL the lineage of degree 1 for all datasets within a specific container. I'm no expert on GraphQL so any help is much appreciated 🙂 Here is my query so far:
{
searchAcrossLineage(
input: {
types: DATASET,
direction: UPSTREAM,
orFilters: [
{
and: [
{
field: "degree",
values: "1"
}
{
field: "container"
values: ["urn:li:container:xxxxxxxxxxx"]
condition: EQUAL
negated: false
}
]
}
]
}
) {
searchResults {
degree
entity {
... on Dataset {
name
platform {
name
}
}
}
}
}
}gray-ocean-32209
01/24/2024, 5:14 PMsearchAcrossLineage or any other GQL method will support lineage getting lineage for all datasets or group of datasets in a container.
one approach get all URNs in the container, loop through each urn to retrieve lineage
here GQL query to get lineage for different degree
query getAllLineageEntities($input: SearchAcrossLineageInput!) {
searchAcrossLineage(input: $input) {
...searchAcrossRelationshipResults
__typename
}
}
fragment searchAcrossRelationshipResults on SearchAcrossLineageResults {
start
count
total
searchResults {
entity {
...searchResultFields
... on Dataset {
__typename
}
__typename
}
degree
}
}
fragment searchResultFields on Entity {
urn
type
... on Dataset {
name
platform {
...platformFields
__typename
}
properties {
name
}
ownership {
...ownershipFields
__typename
}
}
... on Dashboard {
dashboardId
properties {
name
}
ownership {
...ownershipFields
__typename
}
__typename
}
... on Chart {
chartId
properties {
name
}
ownership {
...ownershipFields
__typename
}
__typename
}
... on Container {
properties {
name
}
ownership {
...ownershipFields
__typename
}
subTypes {
typeNames
}
}
... on DataPlatform {
...nonConflictingPlatformFields
}
}
fragment platformFields on DataPlatform {
urn
type
name
properties {
type
displayName
}
displayName
__typename
}
fragment nonConflictingPlatformFields on DataPlatform {
urn
type
name
properties {
displayName
__typename
}
displayName
__typename
}
fragment ownershipFields on Ownership {
owners {
owner {
... on CorpUser {
urn
type
username
}
}
}
}
input:
{
"input": {
"urn": "<entity_urn>",
"direction": "DOWNSTREAM",
"types": [],
"query": "",
"start": 0,
"count": 1000,
"orFilters": [
{
"and": [
{
"field": "degree",
"condition": "EQUAL",
"negated": "false",
"values": [
"1",
"2",
"3+"
]
}
]
}
]
}
}ambitious-bird-91607
01/25/2024, 9:52 AMrich-barista-93413
02/26/2024, 4:56 PM