Connect Apache Zeppelin to Hive

2019-06-01 08:03发布

问题:

I try to connect my apache zeppelin with my hive metastore. I use zeppelin 0.7.3 so there is not a hive interpreter only jdbc. I have copied my hive-site.xml to zeppelin conf folder but I don't know how to create a new hive interpreter.

I also tried to access hive tables through spark's hive context but when I try this way, I can not see my hive databases only a default database is shown.

Can someone explain either how to create a hive interpreter or how to access my hive metastore through spark correctly?

Any answer is appreciated.

回答1:

I solved it by following this documentation. After adding this parameters in jdbc connector you should be able to run hive interpreter with

%jdbc(hive)

In my case it was a little trickier because I used Cloudera Hadoop so the standard jdbc hive connector was not working. So I changed the external hive-jdbc.jar with the one suitable for my cdh version (for cdh 5.9.- for example it located here).

I also find out that you can change hive.url with the one for impala port and connect with jdbc to impala if you prefer.