How do I get a dataset’s owners (not just ownership type, last modified timestamp, etc) in a GraphQP query?
Hey there!
<@U06TM7M40RK> Can you help with the questions in this thread?
Please continue to tag RunLLM (e.g <@U06TM7M40RK>) to have it continue generating responses!
To retrieve a dataset’s owners using a GraphQL query in DataHub, you can use the ownership
field of the dataset
query. This field provides detailed information about the owners of a dataset, including their URNs and types (e.g., CORP_USER
or CORP_GROUP
).
Here is an example of how you can construct a GraphQL query to get the owners of a dataset:
{
dataset(urn: "urn:li:dataset:(urn:li:dataPlatform:hive,SampleHiveDataset,PROD)") {
ownership {
owners {
owner {
... on CorpUser {
urn
type
}
... on CorpGroup {
urn
type
}
}
}
}
}
}
This query will return the URNs and types of the owners associated with the specified dataset. The ... on CorpUser
and ... on CorpGroup
fragments are used to handle different types of owners.
Would you like more detailed guidance on setting up this GraphQL query or any additional information?
Sources:
- <Ownership | DataHub Owners> 0 button 0 button Hint: Mention @runllm in the thread for followups.
Hi ! Did this interaction resolve your issue or do you still require assistance ?
Please tag @ RunLLM if you still need further assistance !
Or tag @Datahub Community Support if you require a person to take a look
Hope this helps ! ><
Yes