Hi guys How can I query the first dataset in a dat...
# getting-started
b
Hi guys How can I query the first dataset in a dataset where the depth of lineage is unknown? For example, When there is a lineage from a > b > c > d >... n, Is there a graphql query statement that can tell at once that n starts with a? i am using python and I checked that I can query about 2 depths using the query below,
Copy code
"""
{
  search(input: { type: CHART, query: "qs", start: 0, count: 10000 }) {
    searchResults {
      entity {
          ...on Chart {
            properties {
                name
            }
            lineage(input: {direction: UPSTREAM , start: 0, count: 10000}) {
                relationships {
                    type
                    entity {
                      ...on Dataset {
                              name
                              lineage(input: {direction: UPSTREAM , start: 0, count: 10000}) {
                                relationships {
                                  entity {
                                    ...on Dataset {name}
                                  }
                                }
                              }
                            }
                    }
                }
            }
         }
      }
    }
  }
}
"""
g
hey @bright-cpu-56427! i think you may be looking for the impact analysis feature
for example
you can see the queries that power the tab are results from searchAcrossLineage graphql endpiont
you can then query for all entities that are upstream of a given entity, filter by entity type to be dataset, and then iterate thru results to see the one with the highest # of steps from the source
b
@green-football-43791 Thanks!! I didn’t know there was such a thing as searchAcrossLineage.