Apache Superset

Apache Superset is an open-source software application for data exploration and data visualization that can handle data at petabyte scale.

Prerequisites

Basic:

  • An active ByteHouse account with API token

Recommended:

  • Python version 3.8 or higher

Install ByteHouse Superset

  1. Clone superset github repository
git clone https://github.com/apache/superset.git
  1. Go to the superset directory
cd superset
  1. Create local requirements docker file
touch ./docker/requirements-local.txt
  1. Add the bytehouse-sqlalchemy connector to the local requirements
echo "bytehouse-sqlalchemy" >> ./docker/requirements-local.txt
  1. Build and run the superset docker container
docker-compose -f docker-compose-non-dev.yml pull
docker-compose -f docker-compose-non-dev.yml up

Connect to ByteHouse

  1. After Superset docker container is built and running, you can use http://localhost:8088/superset/welcome/ to access the Superset UI. By default: Username "admin", Password "admin".
  2. On the top right, go to + dropdown -> Data -> Connect database

  1. From SUPPORTED DATABASES dropdown, choose Other

  1. Fill DISPLAY NAME with any name that you want to assign to your database. Here database means Superset database alias which points to external datasource. Duplicate DISPLAY NAME is not allowed.
  2. Fill SQLALCHEMY URL with bytehouse-connection-uri
  1. region, api_key, database
  2. region, account, user, password, database
// API Key Format
"bytehouse:///?region=$REGION&api_key=$API_KEY&database=$DATABASE"

// API Key Example
"bytehouse:///?region=AP-SOUTHEAST-1&api_key=0x12dKWPk6KwN8&database=test"


// Account, Username, Password Format
bytehouse:///?region=$REGION&account=$ACCOUNT&user=$USER&password=$PASSWORD&database=$DATABASE

// Account, Username, Password example
bytehouse:///?region=AP-SOUTHEAST-1&account=AWSAR17G&user=abc.mazu&password=ABCDE123&database=covid19