Carter Shanklin created HIVE-16941:
--------------------------------------
Summary: INFORMATION_SCHEMA is too hard to set up and use
Key: HIVE-16941
URL: https://issues.apache.org/jira/browse/HIVE-16941
Project: Hive
Issue Type: Bug
Affects Versions: 3.0.0
Reporter: Carter Shanklin
For anyone else out there struggling, here's what you need:
(1) hive-site changes
In your hive-site, add:
{code}
<property>
<name>hive.metastore.db.type</name>
<value>MYSQL</value>
</property>
{code}
Substitute your DB name if it's not MySQL. Note that lower case mysql just
won't do, it must be uppercase. Be sure to restart your metastore.
(2) Use the right schematool invocation
You need to use dbType hive with the correct metaDbType + give it the correct
JDBC endpoint to HiveServer2.
{code}
schematool -metaDbType mysql -dbType hive -initSchema -url
jdbc:hive2://localhost:10000/default -driver org.apache.hive.jdbc.HiveDriver
{code}
(3) At runtime, add a bunch of JARs
In CLI you can use
{code}
add jar
/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/commons-dbcp-1.4.jar;
add jar
/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/commons-dbcp2-2.0.1.jar;
add jar
/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/commons-pool-1.5.4.jar;
add jar
/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/commons-pool2-2.2.jar;
add jar
/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/hive-jdbc-handler-3.0.0-SNAPSHOT.jar;
add jar /usr/share/java/mysql-connector-java.jar;
{code}
For HiveServer2 you'll need to deal with AUX JARs or something like that.
--
At a minimum it's important to eliminate Step (3) as it affects end users
rather than being a one-time setup pain.
The second biggest pain I had personally was getting schematool to work right,
this was largely because of missing validation checks that caused it to do
things that had no chance of working. This will be the subject of an additional
ticket.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)