Apache Zeppelin is a web-based notebook that provides interactive data analytics. Using Zeppelin, you can create interactive and collaborative documents with a rich set of pre-built language backends, or interpreters, such as Scala, Python, SparkSQL, and Hive. Hologres is compatible with PostgreSQL and supports direct connections to Apache Zeppelin for data analytics. This topic describes how to connect Apache Zeppelin to Hologres for visual analytics.
Limits
In the latest version of Apache Zeppelin, the PostgreSQL interpreter has been deprecated and merged into the JDBC interpreter. You can use the JDBC interpreter, which offers the same features, to connect to Hologres.
Connect Apache Zeppelin to Hologres
-
Install Apache Zeppelin.
To install Apache Zeppelin, see the official Apache Zeppelin documentation.
-
Configure the interpreter.
-
Log on to Apache Zeppelin, click your username in the upper-right corner, and select Interpreter from the drop-down menu.

-
In the upper-right corner of the page, click +Create and configure the following parameters to create a new interpreter.

-
Enter a custom name for Interpreter Name.
-
When you create the interpreter, set Interpreter Group to JDBC.
-
-
After you set Interpreter Group to JDBC, configure the following parameters.

Parameter
Description
default.url
The JDBC URL. The format is
jdbc:postgresql://{host}:{port}/{database}. The parameters are described as follows:-
host: The network address of the Hologres instance. Go to the instance details page in the Hologres console and obtain the network address from the Network Information section.
-
port: The port number of the Hologres instance. Go to the instance details page in the Hologres console and obtain the port number from the Network Information section.
-
database: The name of the database that you created in Hologres.
default.user
The AccessKey ID of your Alibaba Cloud account. For more information about how to obtain an AccessKey ID, see Create an AccessKey pair.
default.password
The AccessKey secret of your Alibaba Cloud account. For more information about how to obtain an AccessKey secret, see Create an AccessKey pair.
You can also set other parameters on the page as needed. For more information about the parameters, see the official Apache Zeppelin documentation.
-
-
At the bottom of the page, click Save to save the configuration.
-
-
Create a Notebook to perform data analytics.
When you write SQL in the Notebook, you must add the interpreter name before the SQL statement, such as
%hologres. This allows Zeppelin to use the specified interpreter to generate and send the query. You can specify the data display type on the page. The query results are displayed at the bottom of the page.