Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Apache Superset Quick Start Guide

You're reading from   Apache Superset Quick Start Guide Develop interactive visualizations by creating user-friendly dashboards

Arrow left icon
Product type Paperback
Published in Dec 2018
Publisher
ISBN-13 9781788992244
Length 188 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Shashank Shekhar Shashank Shekhar
Author Profile Icon Shashank Shekhar
Shashank Shekhar
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Getting Started with Data Exploration 2. Configuring Superset and Using SQL Lab FREE CHAPTER 3. User Authentication and Permissions 4. Visualizing Data in a Column 5. Comparing Feature Values 6. Drawing Connections between Entity Columns 7. Mapping Data That Has Location Information 8. Building Dashboards 9. Other Books You May Enjoy

Adding a database

The navigation bar lists all the features. The Sources section is where you will create and maintain database integrations and configure table schemas to use as sources of data.

Any SQL database that has a SQLAlchemy connector such as PostgreSQL, MySQL, SQLite, MongoDB, and Snowflake can work with Superset.

Depending on the databases that we connect to Superset, the corresponding SQLAlchemy connectors have to be installed:

Database
PyPI package
MySQL
mysqlclient
PostgreSQL
psycopg2
Presto
pyhive
Hive
pyhive
Oracle
cx_oracle
SQLite
Included in Superset
Snowflake
snowflake-sqlalchemy
Redshift
sqlalchemy-redshift
MS SQL
pymssql
Impala
impyla
Spark SQL
pyhive
Greenplum
psycopg2
Athena
PyAthenaJDBC>1.0.9
Vertica
sqlalchemy-vertica-python
ClickHouse
sqlalchemy-clickhouse
Kylin
kylinpy
BigQuery
pybigquery

It is recommended that you use a database that supports the creation of views. When columns from more than one table have to be fetched for visualization, views of those joins can be created in the database and visualized on Superset, because table joins are not supported in Superset.

SQL query execution for fetching data and rendering visualizations is done at the database level, and Superset only fetches results afterwards. A database with a query execution engine that scales with your data will make your dashboard more real time.

In this book, we will work with public datasets available in Google BigQuery. We have already installed a connector for BigQuery in our installation routine, using the pip install pybigquery command. We have set up authentication for BigQuery using a key file. You should verify that, by confirming that the environment variable points to the valid key file:

echo $GOOGLE_APPLICATION_CREDENTIALS
# It should return
> /home/<your user name>/.google_cdp_key.json

Now, let's add BigQuery as a database in three steps:

  1. Select the Databases option from the drop-down list and create (+) your first database
  2. Set Database to superset-bigquery and SQLAlchemy URI to bigquery://
  3. Save the database

You can verify the database connection by clicking on the Test Connection button; it should return Seems OK! as follows:

Seems OK! dialog box is generated when test connection to database is successful
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime