How to make hive load meta store from certain path instead of creating at the current directory?
I'm using Hive for some data processing. But whenever I start the Hive-Shell it creates a metastore at the current directory and I can not access to my tables which I created in another directory. This is a bit annoying to me that I have go into specific directory, then star开发者_高级运维t Hive-Shell to see my tables.
I tried to configure the path in hive-default.xml, but no success.
Thanks
A better option than using mysql is simply to modify javax.jdo.option.ConnectionUrl. If this is for a simple development environment, why not use the default derby?
The default is:
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:derby:;databaseName=metastore_db;create=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
Change databaseName=metastore_db
to databaseName=/users/me/.metastore_db
.
Thats it.
Also, see http://www.hiregion.com/2010/01/hive-metastore-derby-db.html for more info on this.
Don't ever edit hive-default.xml, instead edit hive-site.xml. The relevant property is javax.jdo.option.ConnectionURL
You may want to use mysql instead of derby for your metastore. A short article on this is http://blog.milford.io/2010/06/installing-apache-hive-with-a-mysql-metastore-in-centos/
精彩评论