Apache Zeppelin

更新时间:
复制 MD 格式

Apache Zeppelin is a web-based notebook for interactive data analytics. With Zeppelin, you can create interactive, collaborative documents using a wide range of prebuilt language backends (or interpreters), such as Scala, Python, SparkSQL, and Hive. Hologres is compatible with PostgreSQL and supports direct connections from Apache Zeppelin for data analytics. This topic describes how to connect Apache Zeppelin to Hologres and perform data visualization.

Limitations

In the latest version of Apache Zeppelin, the PostgreSQL interpreter has been deprecated and merged into the JDBC interpreter. Use the JDBC interpreter to connect to Hologres.

Connect Apache Zeppelin to Hologres

  1. Install Apache Zeppelin.

    To install Apache Zeppelin, see the Apache Zeppelin official documentation.

  2. Configure an interpreter.

    1. Log on to Apache Zeppelin. In the upper-right corner, click your username and select Interpreter from the dropdown menu.

    2. In the upper-right corner of the page, click +Create to add an interpreter. Configure the Interpreter Name and Interpreter group parameters.

      • Set Interpreter Name to a custom name.

      • Set Interpreter group to JDBC.

    3. After you set Interpreter group to JDBC, configure the following parameters in the Properties table: default.url, default.user, and default.password.

      Parameter

      Description

      default.url

      The JDBC connection URL. Use the format jdbc:postgresql://{host}:{port}/{database}:

      • host: The network address of the Hologres instance. You can find this in the Network Information section on the instance details page in the Hologres console.

      • port: The port of the Hologres instance. You can find this in the Network Information section on the instance details page in the Hologres console.

      • database: The name of the database that you created in Hologres.

      default.user

      The AccessKey ID of your Alibaba Cloud account. To learn how to obtain an access key, see Create an access key.

      default.password

      The AccessKey Secret of your Alibaba Cloud account. To learn how to obtain an access key, see Create an access key.

      You can also configure other parameters based on your business requirements. For more information about the parameters, see the Apache Zeppelin official documentation.

    4. At the bottom of the page, click Save.

  3. Create a notebook to perform data analysis.

    Prefix SQL statements with the configured interpreter name, such as %hologres. This directs Zeppelin to use the correct interpreter. For example, you can run a query like select * from lineitem limit 10 with the %hologres interpreter. After the query status changes to FINISHED, select a chart type from the visualization buttons. To configure a pivot chart, drag fields to the keys area (for example, l_shipmode) and the values area (for example, l_quantity SUM) to group and aggregate the data.