Hey All - I'm having an issue figuring out the rig...
# troubleshoot
r
Hey All - I'm having an issue figuring out the right way to set a filter for a graphql setup. I'd like to filter on dataset entries that come from the platform bigquery. I've tried a bunch of different versions of what to set for the field, but I can't see to find the right one. Example in 🧵
✅ 1
Copy code
query searchAcrossLineage($input: SearchAcrossLineageInput!) {
  searchAcrossLineage(input: $input) {
    start
    count
    total
    searchResults {
      degree
      entity {
        type
        ... on Dataset {
          urn 
          platform {
            name
          }
     matchedFields {
        name
        value
      }
    }
  }
}
-----
{
  "input": {
    "count": 100,
    "urn": "<urn>",
    "direction": "DOWNSTREAM",
    "types": "DATASET",
    "filters": {"field": "name", "value": "bigquery"}
  }
}
I've tried
name
,
platform.name
,
entity.platform.name
,
entity.Dataset.platform.name
and then all result in 0 mathches
b
try using this filter:
Copy code
"filters": {"field": "platform", "value": "urn:li:dataPlatform:bigquery"}
r
oooo that did it!!!!
Its a little confusing trying to understand what the value should be and where to find that urn link. But knowing that it follows that pattern is very helpful!
b
i agree - but absolutely, let me know if there are any additional questions!
r
I actually do have one more! I'm trying to add a secondary filter that matches on fields that are type string. But again I'm stuck on figuring out the right urn to put in. So far I have
Copy code
{
  "field": "type",
  "value": "urn:li:schemaField:STRING"
}
But that doesn't seem to be working.
t
@big-carpet-38439 @rhythmic-stone-77840 I’m trying to get a simple searchAcrossLineage query to work but am having no success. Basically any version of the query (dataset/datajob URN, inline input/header input, different SearchAcrossLineageInput arguments) fails as below. However, a similar query to extract the lineage metadata from the same URN is successful. Any ideas? Query:
Copy code
query {
  searchAcrossLineage(input: {urn: <URN1>, direction: DOWNSTREAM, types: [DATASET], count: 100 }) {
    searchResults {
      entity {
        ... on Dataset {
          urn
          name
        }
      }
    }
  }
}
Result:
Copy code
{
  "errors": [
    {
      "message": "An unknown error occurred.",
      "locations": [
        {
          "line": 3,
          "column": 3
        }
      ],
      "path": [
        "searchAcrossLineage"
      ],
      "extensions": {
        "code": 500,
        "type": "SERVER_ERROR",
        "classification": "DataFetchingException"
      }
    }
  ],
  "data": {
    "searchAcrossLineage": null
  }
}
Successful similar query:
Copy code
query {
  dataset(urn: <URN1>) {
    lineage(input:{direction:DOWNSTREAM, start:0}){
      relationships{
        type
        entity{
          urn
          type
        }
        degree
      }
    }
  }
}
Result:
Copy code
{
  "data": {
    "dataset": {
      "lineage": {
        "relationships": [
          {
            "type": "Consumes",
            "entity": {
              "urn": <URN2>,
              "type": "DATA_JOB"
            },
            "degree": 1
          }
        ]
      }
    }
  }
}
r
I think its the
[]
on
types
- if I remove those then your query runs
And now it works with the
[]
- so weird.
My only other thought it make you have an issue with a downstream edge somewhere? From what I understand
searchAcrossLineage
gives you all downstream nodes, but the
dataset-lineage
of the other query will only give you the nodes directly downstream. So maybe there's an issue traversing further than 1 level?
t
Thank you @rhythmic-stone-77840. The lineage appears correctly in the visualization, so I’m thinking the data should be ok. @big-carpet-38439 Do you have any ideas about what I could try?
s
ls