Use the JDBC interpreter to access Hive
This section describes how to use the Apache Zeppelin JDBC interpreter to access Apache Hive.
The %jdbc
interpreter supports access to Apache Hive data. The
interpreter connects to Hive via Thrift.
If you want Hive queries to run under the user ID originating the query, see "Configuring User Impersonation for Access to Hive" in this guide.
To use the JDBC interpreter to access Hive:
- Add the following directive at the start of a
paragraph:
%jdbc(hive)
- Next, add the query that accesses Hive.
Here is a sample paragraph:
%jdbc(hive) SELECT * FROM db_name;
If you receive an error, you might need to complete the following additional steps:
- Copy Hive jar files to
/opt/cloudera/parcels/<version>/lib/zeppelin/interpreter/<name_of_interpreter>
(or create a soft link).For example,
/opt/cloudera/parcels/<version>/lib/zeppelin/interpreter/livy/
- In the Zeppelin UI, navigate to the
%jdbc
section of the Interpreter page. - Click edit, then add a
hive.proxy.user.property
property and set its value tohive.server2.proxy.user
. - Click Save, then click restart to restart the JDBC interpreter.