Apache Superset and SQL Alchemy usage with OmnisciDB
Hi everyone,
This post provides a brief guide on how to install the SQLAlchemy dialect developed by the community for using the HeavyAI database as a data source in Apache Superset.
To get started, you need to install the dialect package, specifically version 6.0 or later, called `sqlalchemy-heavyai`, in your Python environment (either a virtual environment or Conda). You can easily install it using pip (note that the Conda version may take a few more days to be available).
Once you install the package, your environment will be set up with both the SQLAlchemy dialect and the Python driver.
Happy coding!
(base) mapd@zion-tr:~$ pip install sqlalchemy-heavyai
Collecting sqlalchemy-heavyai
Using cached sqlalchemy_heavyai-1.0-py3-none-any.whl (12 kB)
[CUT]
...
Collecting pyheavydb>=6.0.0
Using cached pyheavydb-6.0.0.post2-py3-none-any.whl (97 kB)
[CUT]
...
Installing collected packages: pyheavydb, sqlalchemy-heavyai
Successfully installed pyheavydb-6.0.0.post2 sqlalchemy-heavyai-1.0.
Now you have to get this file omnisci.txt|attachment (2,0 KB), rename it nto heabydb.py, then place inside your superset installation under the db_engine_specs folder e.g. ~/miniconda3/envs/pymapd/lib/python3.7/site-packages/superset/db_engine_specs
Then restart the superset service.
to add a heavyai database, go in the under the tab Sources, select Database and add a new database with type other and configure the URL to connect following the example
heavydb://admin:your_password@localhost:6274/heavydb
Next, test the connection; a popup should appear in the right corner of the screen.
You can now use the SQL Lab tool to query your database and create charts.
To use this example, you will need a Mapbox key to include in the Superset configuration. We have tested the Dialect and Drivers with Apache Superset versions 1.2 and 1.4. For suggestions on improving support or to report any issues, please use this thread or contact us directly. [GitHub]https://github.com/heavyai/sqlalchemy-heavyai
Please sign in to leave a comment.
Comments
2 comments