0
votes

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.

2
Do you need to access the meta tables directly? HCatalog does give you a good amount of info, but not direct access to the meta tables.Mike Park
Hi climbage. Exactly you understood my question. I need direct access to hive meta tables like "TBLS" which contains all hive table details. Isn't it possible through Hcatalog ?prasad
Climbage, please let me know where can I find "what info Hcatalog can give us?"prasad
Start here. You can get all if this through hive client and hcatalog.Mike Park
Ill try to make a better answer when I get to a real computer (on my phone)Mike Park

2 Answers

1
votes

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);
0
votes

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