Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to get the list of all un-tagged Hive column in Atlas using Rest API command

Solved Go to solution

How to get the list of all un-tagged Hive column in Atlas using Rest API command

New Contributor

How to get the list of all un-tagged hive column/attributes in Atlas using Rest API command

Thank you,

Subash

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to get the list of all un-tagged Hive column in Atlas using Rest API command

Expert Contributor
@subash sharma

Like @Ayub Khan mentioned currently there is no explicit REST end point to fetch all untagged entities, filtered by type (or by any other attributes). Alternatively you could use gremlin query to fetch untagged entities and add additional filters. But please note these queries may not be efficient for large number of entities and tags in the system. Also the result of gremlin query returns a list of vertices in its raw format and needs to be mapped to atlas structure.

http://localhost:21000/api/atlas/discovery/search/gremlin?query=g.V().has('__traitNames', T.notin, g.V().has('__type', 'typeSystem').filter{it.getProperty('__type.category').name() == 'TRAIT'}.'__type.name'.toSet()).has('__typeName', 'hive_column').toList()
5 REPLIES 5
Highlighted

Re: How to get the list of all un-tagged Hive column in Atlas using Rest API command

@subash sharma

AFAIK, there is no REST API to fetch untagged assets. You might want to consider writing small piece of code to filter untagged assets around REST API which returns all assets of specific type, in this case hive_column.

Hope this helps.

Re: How to get the list of all un-tagged Hive column in Atlas using Rest API command

New Contributor

@Ayub Khan, Agreed this can be achieved by code. In Atlas 0.6, I have seen that the length (key value pairs) of tagged entity (hive_column) are 10. Un-tagged column generally used to have 9 key value pairs. We can achieve this using a loop and the process will become time consuming. I was looking for some DSL search query or gremlin query which can give me the list of all untagged columns. I hope this defines my requirement.

Re: How to get the list of all un-tagged Hive column in Atlas using Rest API command

Expert Contributor
@subash sharma

Like @Ayub Khan mentioned currently there is no explicit REST end point to fetch all untagged entities, filtered by type (or by any other attributes). Alternatively you could use gremlin query to fetch untagged entities and add additional filters. But please note these queries may not be efficient for large number of entities and tags in the system. Also the result of gremlin query returns a list of vertices in its raw format and needs to be mapped to atlas structure.

http://localhost:21000/api/atlas/discovery/search/gremlin?query=g.V().has('__traitNames', T.notin, g.V().has('__type', 'typeSystem').filter{it.getProperty('__type.category').name() == 'TRAIT'}.'__type.name'.toSet()).has('__typeName', 'hive_column').toList()

Re: How to get the list of all un-tagged Hive column in Atlas using Rest API command

New Contributor

Hey @Sarath Subramanian, Thank you, can you please let me know any link from where i can get these gremlin queries.

Re: How to get the list of all un-tagged Hive column in Atlas using Rest API command

Expert Contributor