Hi. We can't figure out a working command for CLI ...
# troubleshoot
e
Hi. We can't figure out a working command for CLI to get all dataset urns from within a certaing container. There is such finctionality in UI - Download button in a contaner that gives you a CSV file with info for Datasets: urns and metadata for them (like owners, tags, terms, domains). How do I get the same result using CLI?
a
Hi, i’m not sure this functionality is available in CLI- it would be a good Feature request https://feature-requests.datahubproject.io/
You could use GraphQL in the meantime
s
Hi @astonishing-answer-96712/@hundreds-photographer-13496 could you please tell me how to get the Urn(uniqueId), schemaname, tablename, columnname, columndatatype, description, column level tag(comma separated), data owner for a given schemaname wither from restapi or from graphql?
h
Hey @some-crowd-4662 you should be able to fetch this by either means. However you would need to do some post-processing on your side to translate this to format you require (e.g. comma separated column tags, etc) . With graphQL , following query should work -
Copy code
{
  dataset(
    urn: "urn:li:dataset:(urn:li:dataPlatform:snowflake,long_tail_companions.adoption.pet_profiles,PROD)"
  ) {
    urn
    properties {
      description
    }
    container {
      properties {
        name
      }
    }
    ownership {
      owners {
        owner {
          ... on CorpUser {
            username
          }
          ... on CorpGroup {
            name
          }
        }
        ownershipType {
          type
        }
      }
    }
    schemaMetadata {
      fields {
        fieldPath
        nativeDataType
        type
        description
        tags {
          tags {
            tag {
              properties {
                name
              }
            }
          }
        }
      }
    }
  }
}
you can test this query on DataHub demo instance https://demo.datahubproject.io/api/graphiql and also modify it as required.