Connect Apache Superset to AnalyticDB for PostgreSQL
Apache Superset is an open-source business intelligence (BI) tool for data exploration and visualization. Built on Python, it uses components such as Flask, Pandas, and SQLAlchemy. You can use Apache Superset to create visual, interactive, and collaborative documents. This topic describes how to connect Apache Superset to AnalyticDB for PostgreSQL to visualize and analyze data.
Prerequisites
-
An AnalyticDB for PostgreSQL data source is available.
-
Apache Superset is installed. For more information, see the official Apache Superset website.
Procedure
-
Log in to Superset, and in the top menu bar, select to go to the Databases page.
-
In the upper-right corner of the page, click the
icon to open the Add Database page. Configure the following parameters.Parameter
Description
Database
A custom name for the database connection.
SQLAlchemy URI
The connection string for your AnalyticDB for PostgreSQL database. The SQLAlchemy URI has the following format:
postgresql+psycopg2://<AccessKey ID>:<AccessKey Secret>@<host>:<port>/<Database>The parameters are described as follows:
-
AccessKey ID and AccessKey Secret: The AccessKey ID and AccessKey Secret of your Alibaba Cloud account. To obtain them, see Create an AccessKey pair.
-
host: The internal endpoint of your AnalyticDB for PostgreSQL instance. Find the internal endpoint on the Database Connection page in the AnalyticDB for PostgreSQL console.
-
port: The port of your AnalyticDB for PostgreSQL instance. The default port is 5432.
-
Database: The name of the database in your AnalyticDB for PostgreSQL instance.
For more information, see the SQLAlchemy documentation.
-
-
Click the Test Connection button.
-
If the connection is successful, click save at the bottom of the page.
After saving the configuration, you can use AnalyticDB for PostgreSQL as a data source for visualization and analysis. For more information, see the Apache Superset documentation.