{"id":1857,"date":"2019-06-19T17:57:31","date_gmt":"2019-06-19T12:27:31","guid":{"rendered":"http:\/\/blog.tenthplanet.in\/?p=1857"},"modified":"2026-03-03T10:14:15","modified_gmt":"2026-03-03T10:14:15","slug":"mapr-hive-table-meta-export-to-postgres-db","status":"publish","type":"post","link":"https:\/\/tenthplanet.in\/blogs\/mapr-hive-table-meta-export-to-postgres-db\/","title":{"rendered":"Table meta export from MapR hive to Postgres DB (Database)"},"content":{"rendered":"<p>To Install the PostgreSQL JDBC driver, On the Hive Metastore server host, install libpostgresql-jdbc-java and symbolically link the file to the \/usr\/lib\/hive\/lib\/ directory. For example:<\/p>\n<pre>$ sudo apt-get install libpostgresql-jdbc-java\n$ ln -s \/usr\/share\/java\/postgresql-jdbc4.jar \/opt\/mapr\/hive\/\/hive-&lt;version&gt;\/lib\/postgresql-jdbc.jar<\/pre>\n<p>Create the Metastore database and user accounts.<\/p>\n<pre>$ sudo -u postgres psql\npostgres=# CREATE USER hiveuser WITH PASSWORD 'mypassword';\npostgres=# CREATE DATABASE metastore;<\/pre>\n<p>Configure the Metastore service to communicate with the PostgreSQL database by setting the necessary properties (shown below) in the \/opt\/mapr\/hive\/\/hive-&lt;version&gt;\/conf\/hive-site.xml file.<\/p>\n<p>&lt;property&gt; &lt;name&gt;javax.jdo.option.ConnectionURL&lt;\/name&gt; &lt;value&gt;jdbc:postgresql:\/\/myhost\/metastore&lt;\/value&gt; &lt;\/property&gt;<\/p>\n<pre>&lt;property&gt;\n&lt;name&gt;javax.jdo.option.ConnectionDriverName&lt;\/name&gt;\n&lt;value&gt;org.postgresql.Driver&lt;\/value&gt;\n&lt;\/property&gt;<\/pre>\n<pre>&lt;property&gt;\n&lt;name&gt;javax.jdo.option.ConnectionUserName&lt;\/name&gt;\n&lt;value&gt;hiveuser&lt;\/value&gt;\n&lt;\/property&gt;<\/pre>\n<pre>&lt;property&gt;\n&lt;name&gt;javax.jdo.option.ConnectionPassword&lt;\/name&gt;\n&lt;value&gt;mypassword&lt;\/value&gt;\n&lt;\/property&gt;<\/pre>\n<pre>&lt;property&gt;\n&lt;name&gt;hive.metastore.uris&lt;\/name&gt;\n&lt;value&gt;thrift:\/\/&lt;n.n.n.n&gt;:9083&lt;\/value&gt;\n&lt;description&gt;IP address (or fully-qualified domain name) and port of the metastore host&lt;\/description&gt;\n&lt;\/property&gt;<\/pre>\n<p>Run schemaTool to create the initial DB structure.<\/p>\n<pre>\/opt\/mapr\/hive\/hive-&lt;version&gt;\/bin\/schematool -dbType postgres -initSchema<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Table meta export from MapR hive to Postgres DB<\/p>\n","protected":false},"author":23,"featured_media":1877,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[424],"tags":[541,542,27],"class_list":["post-1857","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pentaho","tag-bigdata-and-pentaho","tag-mapr-hive-table","tag-postgresql"],"acf":[],"_links":{"self":[{"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/posts\/1857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/comments?post=1857"}],"version-history":[{"count":0,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/posts\/1857\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/media\/1877"}],"wp:attachment":[{"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/media?parent=1857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/categories?post=1857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tenthplanet.in\/blogs\/wp-json\/wp\/v2\/tags?post=1857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}