0

I know it is possible to have a metastore located on a remote server. In order to set this up, I must specify the ConnectionURL, Driver, Username, and Password in the hive-site.xml file. Is it possible to access the information in the hive-site.xml file from the hive shell?

4

1 回答 1

1

You could use the SET command through the Hive CLI. But it prints all the variables in the namespaces hivevar, hiveconf, system, and env. So, you could use it with grep to print just the properties you need. For example if you want to see what is the value of mapred.reduce.tasks which you set in hive-site.xml then you could do this :

bin/hive -S -e "set" | grep mapred.reduce.tasks

Or to get the metastore related info you could do this :

bin/hive -S -e "set" | grep metastore

I don't know if this what you were expecting, but it does the trick for me. Hope this helps you too.

于 2013-06-05T02:09:48.873 回答