Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

How to fetch total numbers of tables available in a Schema using Rest API search techniques ?

avatar
Expert Contributor

How to get the list pf all the tables available in a particular schema. This Rest API command generally gives the GUID and total count of all tables available in Atlas.

http://hostname:port/api/atlas/entities?type=hive_table

Can we apply some sort of filter on database or schema ?

Thank you,

Subash

1 ACCEPTED SOLUTION

avatar
Super Collaborator

@subash sharma

DSL query : hive_table where db.name="default" lists down all the hive tables in "default" database.

V1 Query which can be used in Atlas 0.7 :

/api/atlas/discovery/search/dsl?query=hive_table+where+db.name%3D%22default%22

View solution in original post

13 REPLIES 13

avatar
Expert Contributor

Hey @Sharmadha Sainath,

I was not able to add comment so adding my reply here, actually i was using space instead of "=" in limit. It is working now. Thanks

avatar
Expert Contributor

The following gremlin query can also be used the get the count of entity type:

  • http://localhost:21000/api/atlas/discovery/search/gremlin?query=g.V("__typeName", "hive_db").count()
  • http://localhost:21000/api/atlas/discovery/search/gremlin?query=g.V("__typeName", "hive_table").count()

avatar
Expert Contributor

Thank you @Sarath Subramanian. Right now i am using DSL for searching the tables in a schema. Let me know which one should be good in terms of performance. Gremlin or DSL.

avatar
Super Collaborator

@subash sharma , DSL query makes GREMLIN call internally to fetch results.