Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive >> mail # user >> How to load hive metadata from conf dir


Copy link to this message
-
How to load hive metadata from conf dir
Hello Hive Users,

I am writing a program in java which is bundled as JAR and executed using
hadoop jar command. I would like to access hive metadata (read partitions
informations) in this program. I can ask user to set HIVE_CONF_DIR
environment variable before calling my program or ask for any reasonable
parameters to be passed. I do not want to force user to run hive megastore
service if possible to increase reliability of program by avoiding
external dependencies.

What is the recommended way to get partitions information? Here is my
understanding
1. Make sure my jar is bundled with hive-metastore[1] library.
2. Use HiveMetastoreClient[2]

Is this correct? If yes, how to read the hive configuration[3] from
HIVE_CONF_DIR?

[1] http://mvnrepository.com/artifact/org.apache.hive/hive-metastore
[2]
http://hive.apache.org/docs/r0.7.1/api/org/apache/hadoop/hive/metastore/Hiv
eMetaStoreClient.html
[3]
http://hive.apache.org/docs/r0.7.1/api/org/apache/hadoop/hive/conf/HiveConf
.html

Thanks in advance,
Parag
+
Mark Grover 2013-02-12, 04:57
+
Parag Sarda 2013-02-12, 08:18
+
Nitin Pawar 2013-02-12, 08:25
+
Parag Sarda 2013-02-12, 16:36
+
Dean Wampler 2013-02-12, 14:41
+
Edward Capriolo 2013-02-12, 16:53
+
Parag Sarda 2013-02-12, 17:31
+
Dean Wampler 2013-02-12, 16:55