Modern versions of elasticsearch (ship with a JDBC driver)[https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-jdbc.html], which converts all normal SQL requests into compatible ESQL and communicates with the ES backend.
This project maintains a metabase driver for this setup.
This project is not even alpha quality yet...
- Make sure username/passwords work
- Make sure https support works
- Make sure non-placeholder values for all connection params work
- Impemlement proper defaults for all connection properties
- Implement table discovery
This repo contains a (full ES+Kibana)[https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html] stack.
docker-compose up
# test
curl -X GET "localhost:9200/_cat/nodes?v&pretty"
Open the (local Kibana Server)[http://localhost:5601], click on the "Sample Data" tab, and load the "Sample Flight Data". Click "Dashboard" when done to verify it's all working.
Open the (local Kibana Server's license page)[http://localhost:5601/app/management/stack/license_management] and click "Activate Trial".
(Set up JDK & clojure for dev)[https://purelyfunctional.tv/guide/how-to-install-clojure/].
You'll need to add the new JDK to your path... something like:
export PATH=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin:$PATH
# Check for JDK...
java -version
> openjdk version "11.0.9.1" 2020-11-04
> OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9.1+1)
> OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9.1+1, mixed mode)
Once you have the full clj
stack working...
The best way to do development on drivers is to download the (metabase-core
codebase)[https://github.com/metabase/metabase] and drop this project into modules/drivers
.
# somewhere on your machine...
git clone git@github.com:metabase/metabase.git
cd metabase
lein install-for-building-drivers
# install our plugin
cd modules/drivers
git clone git@github.com:apinstein/metabase-es-sql-driver.git
NOTE: Failure to have metabase-core built properly via lein install-for-building-drivers
will result in errors that look like the compiler not seeing functions from metabase-core that you know exist.
Open the (Metabase Server)[http://localhost:3000] and complete the initialization steps. Skip adding a data source.
Make your changes and run this to compile & re-run metabase.
DEBUG=1 LEIN_SNAPSHOTS_IN_RELEASE=true lein uberjar \
&& cp target/uberjar/elasticsearch.metabase-driver.jar ./metabase/plugins
# kill and restart metabase
java -jar metabase.jar
select 1
select * from kibana_sample_data_flights