Support Questions

Find answers, ask questions, and share your expertise

Impala/Hive - Query sys.tables objects

avatar
Rising Star

Hi experts,

There exists any way to make a query to sys.tables like we do on T-SQL, like:

SELECT *FROM sys.tables

Is this possible in Impala or Hive?

Thanks!

2 REPLIES 2

avatar

Hey @Pedro Rodgers!
AFAIK, you don't have the same graceful way to query metadata from Hive/Impala as Sql server.
Since they use a DBMS behind the scenes to keep their meta. You'll probably need to access directly the DBMS and run some queries there.
So for instance, let's say that you have a hive/impala with a MySql as its Metastore/Catalog, in this case you'll need to access the mySql to gather info about Hive/Impala.
But.. there's some tools from hive side, that may can be useful for you 🙂
https://cwiki.apache.org/confluence/display/Hive/Hive+Schema+Tool
https://cwiki.apache.org/confluence/display/Hive/Hive+MetaTool
https://cwiki.apache.org/confluence/display/Hive/HCatalog+CLI

Hope this helps! 🙂

avatar
New Contributor

Later versions of hive have a "sys" DB that under the hood connects back to the hive metastore database (eg Postgres or whatever). and you can query that.

Impala seems not to be able to see this sys db though.

 

There is also a "information_schema" DB with a smaller and cleaner subset but it points back to sys and also not visible from impala if you do a "show databases;"

 

You can use "show" statements in impala-shell but I'm not sure there is a DB to through SQL at via ODBC/JDBC. 

 

Still looking for a way to do this in impala