Search code examples
dockersqlalchemyclickhouseapache-superset

Superset for Clickhouse in docker with SQLAlchemy


I'm trying to setup Apache Superset for Clickhouse. My understanding so far is that I need to install SQLAlchemy for Clickhouse https://github.com/xzkostyan/clickhouse-sqlalchemy

I'm in Ubuntu 16.04 LTS, and using the Docker vanilla version of Clickhouse and of Superset:

without special settings

Any idea how I can bridge the two docker containers with clickhouse-sqlalchemy ? Where and how in that case to install that? (if you have sample command line that I can reuse that will be great)


Solution

  • You don't need to bridge them: what you want is a superset server (that you happen to be running via docker) to connect to a clickhouse database (that you also happen to be running via docker).

    You also shouldn't need to install SQLAlchemy for Clickhouse: looking at the dockerfile at https://hub.docker.com/r/amancevice/superset/~/dockerfile/ that image has already sqlalchemy-clickhouse installed for you.

    Your steps should be as follow:

    • When you docker run --detach --name superset [options] amancevice/superset you should have your superset instance running at http://localhost:8088/

    • Similarly, when you run $ docker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 -v /path/to/your/config.xml:/etc/clickhouse-server/config.xml yandex/clickhouse-server you should end-up with a clickhouse instance that you can access via SQLAlchemy at something like clickhouse://default:@some-clickhouse-server/test You'd need to modify that connection URI based on your config.xml - and you should be able to double-check that it works by connecting to it in your python console.

    • You should then be able to connect superset to your clickhouse db in the same way you'd connect to any other DB: by navigating into Superset's menu > Sources > Databases > [new]