Configuring Superset to Connect to DLI for Data Query and Analysis
Superset is an open-source data exploration and visualization platform. It supports fast and intuitive data exploration, and enables rich visualizations and interactive dashboards.
By interconnecting Superset with DLI, you can access DLI for data query and analysis. This simplifies data access workflows and provides unified data management and analytics capabilities, enabling deeper data insights.
This section describes the steps for connecting Superset to DLI.
Preparations
- Obtaining the Superset installation package
Get the Superset installation package. For details, see Installing Superset.
For installation guidance, visit the Superset official website.
- Obtaining the DLI JDBC driver
Download the dli-sdk-python driver from the DLI management console.
- Preparing connection information
Table 1 Connection information Item
Description
How to Obtain
DLI's AK/SK
AK/SK-based authentication uses an AK/SK pair to sign requests for identity authentication.
DLI endpoint address
Endpoint of a cloud service in a region.
DLI project ID
Project ID used for resource isolation.
DLI region information
Region to which DLI belongs.
Step 1: Install Superset and Configure the Data Connection Driver
- Download and install Superset.
For details, see Installing Superset.
The following uses Docker-based Superset installation as an example:
- Install Docker on the current host.
- Pull the Superset Docker image.
docker pull apache/superset
- Start the Superset container.
docker run -p 8088:8088 apache/superset
This starts the Superset container and maps container port 8088 to host port 8088.
- Access Superset.
In a browser, open http://IP address:8088 (where IP address is the IP address of the host where Superset is deployed) and log in to Superset using the username and password configured during Superset installation.
- Install and configure the DLI driver in Superset to connect to the database.
The driver must be placed in the Superset classpath, for example, the superset-classpath directory.
Extract the installation package and install the DLI driver in the Superset client.
Run Python setup.py install to install the dli-sdk-python in the local environment.
Figure 1 Installing the JDBC driver in the Superset client
- After driver installation and configuration are complete, restart the Superset service to ensure the driver takes effect.
Step 3: Configure Superset to Connect to DLI
In Superset, add a database connection as follows:
- Open Superset and log in.
- Choose Settings > Database Connections and click + DATABASE. Figure 2 Choosing Settings
Figure 3 Clicking + DATABASE
- In the dialog box that appears, set SUPPORTED DATABASES to DLI. Figure 4 Selecting DLI
- Configure data connection details.
- DISPLAY NAME: Custom data connection name.
- SQL ALCHEMY URI: Data connection URL.
Data connection URL format:
dli://<accesskey_id>:<accesskey_secret>@<region_id>/?projectid=<project_id>&queuename=<dli_queue_name>&databasename=<dli_default_database_name>&enginetype=<engine_type>&catalog=< lakeformation_catalog_name>
Table 2 Superset-to-DLI parameter description Parameter
Mandatory
Description
Example Value
accesskey_id and accesskey_secret
Yes
AK/SK credentials.
-
region_id
Yes
Region name.
ap-southeast-2
projectid
Yes
Project ID where DLI resources are located.
0b33ea2a7e0010802fe4c009bb05076d
queuename
Yes
DLI queue name.
dli_test
databasename
Yes
Default database to access.
dli
enginetype
No
DLI queue type. Options:
spark: Spark engine queue.
The default value is spark.
spark
catalog
No
Metadata catalog name.
For example, if using a LakeFormation catalog named lfcatalog, the configuration is as follows: catalog=lfcatalog.
Figure 5 Configuring URL information
- After entering the connection information, click TEST CONNECTION to verify connectivity. If the message Connection looks good! appears, the connection is successful.
- If the test succeeds, click CONNECT to establish a data connection with DLI.
- Click OK to save the connection.
Step 3: Query and Analyze Data Using Superset
- View table information.
In the top menu of Superset, choose Datasets. On the right side, click + DATASET and set DATABASE, SCHEMA, and TABLE to preview table information.
Figure 6 Previewing table information in Superset
- Create a dataset.
Click CREATE DATASET AND CREATE CHART in the lower right corner.
Figure 7 CREATE DATASET AND CREATE CHART
- Visualize and analyze data.
On the dataset page, select the target table and configure the chart type and dimensions to display business analytics charts.
Figure 8 Visual data analysis using Superset
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot