Skip to main content

Superset

Superset is fast, lightweight, intuitive, and loaded with options that make it easy for users of all skill sets to explore and visualize their data, from simple line charts to highly detailed geospatial charts.

Databend integrates with Superset through two Python libraries: databend-py and databend-sqlalchemy. To achieve this integration, you need to build a custom Docker image based on the official Superset Docker image, incorporating these two libraries. databend-py acts as the Python client library for Databend, allowing Superset to communicate with the Databend server, execute queries, and retrieve results through its API. Concurrently, databend-sqlalchemy serves as the SQLAlchemy adapter for Databend, enabling Superset to integrate with Databend using the SQLAlchemy framework. It facilitates the conversion of SQL queries generated by Superset into a format understandable by Databend through SQLAlchemy's interface.

Tutorial: Integrating with Superset

This tutorial guides you through the process of integrating Databend Cloud with Superset.

1

Building Superset Image
Copy Link

These steps involve creating a customized Superset Docker image with Databend integration:

  1. Starts with the official Superset Docker image as the foundational base. Edit the Dockerfile, permissions are elevated to install essential packages.
Dockerfile
FROM apache/superset
# Switching to root to install the required packages
USER root
RUN pip install databend-py
RUN pip install databend-sqlalchemy
# Switching back to using the `superset` user
USER superset
  1. Build a Docker image with the tag "superset-databend:v0.0.1" using the current directory as the build context.
docker build -t superset-databend:v0.0.1 .
  1. Run a Docker container using the "superset-databend:v0.0.1" image.
docker run -d -p 8080:8088 -e "SUPERSET_SECRET_KEY=<your_secret_key>" --name superset --platform linux/x86_64 superset-databend:v0.0.1
2

Setting Up Superset
Copy Link

  1. Create an administrator user.
docker exec -it superset superset fab create-admin \
--username admin \
--firstname Superset \
--lastname Admin \
--email admin@superset.com \
--password admin
  1. Apply any necessary database migrations to ensure that the Superset database schema is up to date.
docker exec -it superset superset db upgrade
  1. Initializes Superset.
docker exec -it superset superset init
3

Connecting to Databend Cloud
Copy Link

  1. Navigate to http://localhost:8080/login/ and use the credentials admin/admin for the username and password to log in.

  2. Select Settings > Data > Connect Database to open the connection wizard.

Alt text

  1. Select Other from the list of supported databases.

Alt text

  1. On the BASIC tab, set a display name, for example, Databend, and then enter the URI to connect to Databend Cloud. The URI follows the format: databend://<host>, where <host> corresponds to the host field in your warehouse's connection information. For information on how to obtain the connection details, refer to Connecting to a Warehouse.

Alt text

  1. Click TEST CONNECTION, which should result in a popup message saying, "Connection looks good!".
Did this page help you?
Yes
No
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today