ClickHouse (github) database driver for the Metabase (github) business intelligence front-end
- Download a fairly recent Metabase binary release (jar file) from the Metabase distribution page.
- Download the ClickHouse driver jar from this repository's "Releases" page
- Create a directory and copy the
metabase.jar
to it. - In that directory create a sub-directory called
plugins
. - Copy the ClickHouse driver jar to the
plugins
directory. - Make sure you are the in the directory where your
metabase.jar
lives. - Run
MB_PLUGINS_DIR=./plugins; java -jar metabase.jar
.
Metabase Release | Driver Version |
---|---|
0.33.x | 0.6 |
0.34.x | 0.7.0 |
0.35.x | 0.7.1 |
0.37.3 | 0.7.3 |
0.38.1 | 0.7.5 |
Please refer to the extensive documentation available in the Metabase Wiki: Writing A Driver
- Clone metabase repository
- Clone this repository, and follow the instructions for building the driver. Alternatively, download a pre-release jar.
- Copy
clickhouse.metabase-driver.jar
into your Metabaseplugins
directory - Start Metabase, e.g. by invoking
lein run
in your Metabase directory.
If you want to develop simply create a symbolic link from the Metabase modules/drivers
directory to the root of the driver directory.
This is the recommended way, according to the fine manual:
docker run -d -p 3000:3000 \
--mount type=bind,source=/path/to/plugins,destination=/plugins \
--name metabase metabase/metabase
In an empty directory, create your Dockerfile, e.g. Dockerfile-clickhouse
FROM metabase/metabase:latest
ADD https://github.com/enqueue/metabase-clickhouse-driver/releases/download/0.7.5/clickhouse.metabase-driver.jar /plugins/
RUN chmod 744 /plugins/clickhouse.metabase-driver.jar
Assemble
docker build -f Dockerfile-clickhouse -t foo/metabase-with-clickhouse .
Run
docker run --rm -d=false -p 3000:3000 --name metabase foo/metabase-with-clickhouse
Please refer to the fine Metabase operations manual to find out how to operate a dockerized Metabase with a regular database.
The driver should work fine for many use cases. Please consider the following items when running a Metabase instance with this driver:
- Create a dedicated user for Metabase, whose profile has
readonly
set to 2. - Consider running the Metabase instance in the same time zone as your ClickHouse database; the more time zones involved the more issues.
- Compare the results of the queries with the results returned by
clickhouse-client
. - Metabase is a good tool for organizing questions, dashboards etc. and to give non-technical users a good way to explore the data and share their results. The driver cannot support all the cool special features of ClickHouse, e.g. array functions. You are free to use native queries, of course.
Newer versions of this driver require ClickHouse JDBC driver version 0.30 which has not been released, yet. Until this version is released, please check out the develop branch of the ClickHouse JDBC driver and install into your local Maven repository. If you have any questions about building this driver, please do not hesitate to contact me.
- Report any issues you encounter during operations
- Create a pull request, preferably with a test or five
- See the very useful documentation by the Metabase team: Writing A Driver
The contents of this repository are made available under the GNU Affero General Public License v3.0 (AGPL), see LICENSE. Unless explicitly stated differently in the respective file, all files are Copyright 2018-2021 the metabase-clickhouse-driver contributors
.