Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.0.1 a working version metabase driver for Timeplus Proton. More enhancements to do #2

Merged
merged 9 commits into from
Nov 18, 2023
Prev Previous commit
refine README, ready to publish 0.0.1
  • Loading branch information
jovezhong committed Nov 18, 2023
commit c38ed89388d52a96141708835511a2a0abedf1c2
14 changes: 7 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ assignees: ''

### Configuration
#### Environment
* metabase-clickhouse-driver version:
* metabase-clickhouse-driver configuration:
* metabase-proton-driver version:
* metabase-proton-driver configuration:
* Metabase version:
* OS:

#### ClickHouse server
* ClickHouse Server version:
* ClickHouse Server non-default settings, if any:
* `CREATE TABLE` statements for tables involved:
* Sample data for all these tables, use [clickhouse-obfuscator](https://github.com/ClickHouse/ClickHouse/blob/master/programs/obfuscator/Obfuscator.cpp#L42-L80) if necessary
#### Proton server
* Proton Server version:
* Proton Server non-default settings, if any:
* `CREATE STREAM` statements:
* Sample data
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

This repo is a forked from https://github.com/ClickHouse/metabase-clickhouse-driver with necessary revisions to better fit streaming processing and Proton.

## Configuring
## Add database

1. Once you've started up Metabase, open http://localhost:3000 , go to add a database and select "proton".
2. You'll need to provide the Host/Port, Database Name, Username and Password.
1. Once you've started up Metabase, open http://localhost:3000 , go to "Admin settings" (top-right), then "Databases" tab and add a database and select "Timieplus Proton".
2. You'll need to provide the Host/Port. Default localhost and 3218 just work.

## Run Query
Please note, by default Proton's query behavior is streaming SQL, looking for new data in the future and never ends. This can be considered as hang for Metabase. So please use `select .. from .. LIMIT 100` to stop the query at 100 events. Or use a historical query, such as `select .. from table(car_live_data)..`

### Build from source
The build process is largely based on https://github.com/databendcloud/metabase-databend-driver. (IMHO, Leiningen provides much better compiling error message than the built-in `clojure -X:build:drivers:build/driver`)

### Prerequisites

Expand Down Expand Up @@ -50,7 +54,7 @@ This repo is a forked from https://github.com/ClickHouse/metabase-clickhouse-dri
LEIN_SNAPSHOTS_IN_RELEASE=true DEBUG=1 lein uberjar
```

5. Let's assume we download `metabase.jar` from the [Metabase jar](https://www.metabase.com/docs/latest/operations-guide/running-the-metabase-jar-file.html) to `~/metabase/` and we built the project above. Copy the built jar to the Metabase plugins directly and run Metabase from there!
5. Let's assume we download `metabase.jar` from the [Metabase jar](https://www.metabase.com/docs/latest/operations-guide/running-the-metabase-jar-file.html) to `~/metabase/` and we built the project above. Copy the built jar(proton.metabase-driver.jar) to the Metabase plugins directly and run Metabase from there!

```shell
cd ~/metabase/
Expand All @@ -60,6 +64,6 @@ This repo is a forked from https://github.com/ClickHouse/metabase-clickhouse-dri
You should see a message on startup similar to:

```
2019-05-07 23:27:32 INFO plugins.lazy-loaded-driver :: Registering lazy loading driver :proton...
2019-05-07 23:27:32 INFO metabase.driver :: Registered driver :proton (parents: #{:sql-jdbc}) 🚚
2023-11-18 09:55:37,102 DEBUG plugins.lazy-loaded-driver :: Registering lazy loading driver :proton...
2023-11-18 09:55:37,102 INFO driver.impl :: Registered driver :proton (parents: [:sql-jdbc]) 🚚
```
9 changes: 4 additions & 5 deletions resources/metabase-plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
info:
name: Metabase Proton Driver
version: 0.0.1-SNAPSHOT
version: 0.0.1
description: Allows Metabase to connect to Timeplus Proton databases
contact-info:
name: Jove Zhong
address: jove@timeplus.com
dependencies:
- class: com.timeplus.proton.jdbc.ProtonDriver
driver:
name: proton
display-name: Metabase Proton Driver
display-name: Timeplus Proton
lazy-load: true
parent: sql-jdbc
connection-properties:
- host
- name: host
default: "localhost"
- merge:
- port
- default: 3218
Expand Down