@@ -89,16 +89,38 @@ JDBC bridge for ClickHouse®. It acts as a stateless proxy passing queries from
89
89
--query=" select * from jdbc('self?datasource_column', 'select 1')"
90
90
` ` `
91
91
92
+ * Debian/RPM Package
93
+
94
+ Besides docker, you can download and install released Debian/RPM package on existing Linux system.
95
+
96
+ Debian/Ubuntu
97
+ ` ` ` bash
98
+ apt update && apt install -y procps wget
99
+ export JDBC_BRIDGE_VERSION=2.0.0
100
+ wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$JDBC_BRIDGE_VERSION /clickhouse-jdbc-bridge_$JDBC_BRIDGE_VERSION -1_all.deb
101
+ apt install --no-install-recommends -f ./clickhouse-jdbc-bridge_$JDBC_BRIDGE_VERSION -1_all.deb
102
+ clickhouse-jdbc-bridge
103
+ ` ` `
104
+
105
+ CentOS/RHEL
106
+ ` ` ` bash
107
+ yum install -y wget
108
+ export JDBC_BRIDGE_VERSION=2.0.0
109
+ wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$JDBC_BRIDGE_VERSION /clickhouse-jdbc-bridge-$JDBC_BRIDGE_VERSION -1.noarch.rpm
110
+ yum localinstall -y clickhouse-jdbc-bridge-$JDBC_BRIDGE_VERSION -1.noarch.rpm
111
+ clickhouse-jdbc-bridge
112
+ ` ` `
113
+
92
114
* Java CLI
93
115
94
116
` ` ` bash
95
117
export JDBC_BRIDGE_VERSION=2.0.0
96
- wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$JDBC_BRIDGE_VERSION /clickhouse-jdbc-bridge-$JDBC_BRIDGE_VERSION .jar
118
+ wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$JDBC_BRIDGE_VERSION /clickhouse-jdbc-bridge-$JDBC_BRIDGE_VERSION -shaded .jar
97
119
# add named datasource
98
120
wget -P config/datasources https://raw.githubusercontent.com/ClickHouse/clickhouse-jdbc-bridge/master/misc/quick-start/jdbc-bridge/config/datasources/ch-server.json
99
121
# start jdbc bridge, and then issue below query in ClickHouse for testing
100
122
# select * from jdbc('ch-server', 'select 1')
101
- java -jar clickhouse-jdbc-bridge-$JDBC_BRIDGE_VERSION .jar
123
+ java -jar clickhouse-jdbc-bridge-$JDBC_BRIDGE_VERSION -shaded .jar
102
124
` ` `
103
125
104
126
@@ -195,6 +217,13 @@ Assuming you started a test environment using docker-compose, please refer to ex
195
217
196
218
* Mutation
197
219
` ` ` sql
220
+ -- use query parameter
221
+ select * from jdbc(' ch-server?mutation' , ' drop table if exists system.test_table' );
222
+ select * from jdbc(' ch-server?mutation' , ' create table system.test_table(a String, b UInt8) engine=Memory()' );
223
+ select * from jdbc(' ch-server?mutation' , ' insert into system.test_table values(' ' a' ' , 1)' );
224
+ select * from jdbc(' ch-server?mutation' , ' truncate table system.test_table' );
225
+
226
+ -- use JDBC table engine
198
227
drop table if exists system.test_table;
199
228
create table system.test_table (
200
229
a String,
@@ -205,7 +234,7 @@ Assuming you started a test environment using docker-compose, please refer to ex
205
234
create table system.jdbc_table (
206
235
a String,
207
236
b UInt8
208
- ) engine=JDBC(' ch-server' , ' system' , ' test_table' );
237
+ ) engine=JDBC(' ch-server?batch_size=1000 ' , ' system' , ' test_table' );
209
238
210
239
insert into system.jdbc_table(a, b) values(' a' , 1);
211
240
@@ -280,8 +309,9 @@ Assuming you started a test environment using docker-compose, please refer to ex
280
309
Couple of timeout settings you should be aware of:
281
310
1. datasource timeout, for example: `max_execution_time` in MariaDB
282
311
2. JDBC driver timeout, for example: `connectTimeout` and `socketTimeout` in [MariaDB Connector/J](https://mariadb.com/kb/en/about-mariadb-connector-j/)
283
- 3. Vertx timeout - see ` config/server.json` and ` config/vertx.json`
284
- 4. Client(ClickHouse JDBC driver) timeout - see timeout settings in ClickHouse JDBC driver
312
+ 3. JDBC bridge timeout, for examples: `queryTimeout` in ` config/server.json` , and ` maxWorkerExecuteTime` in ` config/vertx.json`
313
+ 4. ClickHouse timeout like ` max_execution_time` and ` keep_alive_timeout` etc.
314
+ 5. Client timeout, for example: `socketTimeout` in ClickHouse JDBC driver
285
315
286
316
287
317
# # Migration
@@ -375,7 +405,7 @@ Test Case | Time Spent(s) | Throughput(#/s) | Failed Requests | Min(ms) | Mean(m
375
405
[clickhouse_constant-query](misc/perf-test/results/clickhouse_constant-query.txt) | 797.775 | 125.35 | 0 | 1 | 159 | 4 | 1,077
376
406
[clickhouse_constant-query(mysql)](misc/perf-test/results/clickhouse_constant-query(mysql).txt) | 1,598.426 | 62.56 | 0 | 7 | 320 | 18 | 2,049
377
407
[clickhouse_constant-query(remote)](misc/perf-test/results/clickhouse_constant-query(remote).txt) | 802.212 | 124.66 | 0 | 2 | 160 | 8 | 3,073
378
- [clickhouse_constant-query(url)](misc/perf-test/results/clickhouclickhouse_constant -query(url)se_ping .txt) | 801.686 | 124.74 | 0 | 3 | 160 | 11 | 1,123
408
+ [clickhouse_constant-query(url)](misc/perf-test/results/clickhouse_constant -query(url).txt) | 801.686 | 124.74 | 0 | 3 | 160 | 11 | 1,123
379
409
[clickhouse_constant-query(jdbc)](misc/perf-test/results/clickhouse_constant-query(jdbc).txt) | 925.087 | 108.10 | 5,813 | 14 | 185 | 75 | 4,091
380
410
[clickhouse(patched)_constant-query(jdbc)](misc/perf-test/results/clickhouse(patched)_constant-query(jdbc).txt) | 833.892 | 119.92 | 1,577 | 10 | 167 | 51 | 3,109
381
411
[clickhouse(patched)_constant-query(jdbc-dual)](misc/perf-test/results/clickhouse(patched)_constant-query(jdbc-dual).txt) | 846.403 | 118.15 | 3,021 | 8 | 169 | 50 | 3,054
0 commit comments