Is there a way to access hive metastore tables from HCATALOG?

In my application, I am using hive metastore(mysql) from JDBC. Now the requirement got changed and I won't be able to get metastore credentials. Hence I can't use JDBC to access metastore.

I wanted to know, Is there a way to access hivemetastore tables like TBLS and INDXS from HCATALOG? Thanks in advance.

Answers


You can probably get most of the information you need through HCatalog, without direct access to the metastore tables.

HiveConf conf = new HiveConf(); // should pull hive-site.xml automatically
HiveMetaStoreClient hiveClient = new HiveMetaStoreClient(conf);
Table hiveTable = HCatUtil.getTable(hiveClient, "default", "sometable");

... = hiveTable.getAllIndexes(max);

Yes, that's what HCatalog is all about: access and manipulate the metastore. See SHOW TABLES.


Need Your Help

How to import Rails helpers in to the functional tests

ruby-on-rails unit-testing ruby-on-rails-3 functional-testing

Hi I recently inherited a project in which the former dev was not familiar with rails, and decided to put a lot of important logic into the view helpers.