Created on 12-07-202110:29 PM - edited on 12-07-202110:30 PM by subratadas
In this article, we will learn how to integrate Zeppelin JDBC (Phoenix) interpreter example.
1. Configuring the JDBC (Phoenix) interpreter: Login to Zeppelin UI -> Click on the user name (in my case, admin) at the right-hand corner. It will display a menu > click on Interpreter.
Click on + Create at the right-hand side of the screen.
It will display a popup menu. Enter Interpreter Name as jdbc and select Interpreter Group as jdbc. Then, it will populate Properties in table format.
Click on + button and add the Phoenix-related properties according to your cluster, and click on the Save button.
phoenix.driver
org.apache.phoenix.jdbc.PhoenixDriver
phoenix.url
jdbc:phoenix:localhost:2181:/hbase
phoenix.user
phoenix.password
2. Creating the Notebook:
Click Notebook dropdown menu in the top left-hand corner and select Create new note and enter Note Name as Phoenix_Test,and selectDefault Interpreter as jdbc. Finally, click on Create button.
3. Running the Phoenix queries using jdbc (Phoenix) interpreter in Notebook:
%jdbc(phoenix)
CREATE TABLE IF NOT EXISTS Employee (
id INTEGER PRIMARY KEY,
name VARCHAR(225),
salary FLOAT
)
%jdbc(phoenix)
UPSERT INTO Employee VALUES(1, 'Ranga Reddy', 24000)
%jdbc(phoenix)
UPSERT INTO Employee (id, name, salary) VALUES(2, 'Nishantha', 10000)
%jdbc(phoenix)
select * from Employee