Hive – Where can I get the hive metastore details (Credentials,Host,Server etc)

In General we don’t deal directly with Hive metastore . But there are some situation that we may need to query directly to metastore to get some information easily, and to automate some task.

For example
To get partition location of all the table.
To integrate hive with snowflake etc.

The metastore information you can get from hive-site.xml

In AWS EMR hive-site.xml is located in /etc/hive/conf  . Most of the system the location will be same 

You can do a cat hive-site.xml  to get the bellow information. Here the metstore is hosted in mysql database.

<property>
<name>hive.metastore.uris</name>
<value>thrift://ip-10-21-220-21.ec2.internal:9083</value>
<description>JDBC connect string for JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://dev-hivemeta.freshers-in.us-east-1.rds.aws.com:3306/sys/hive?createDatabaseIfNotExist=true</value>
<description>username to use against metastore db</description>
</property>

<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.mariadb.jdbc.Driver</value>
<description>username to use against metastore db</description>
</property>

<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>freshers_in_user</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>freshers_in_password</value>
<description>password to use against metastore database</description>
</property>
Author: user

Leave a Reply