Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 180f8cf

Browse files
committed
Update README, bump CH, adjust docker compose
1 parent f240762 commit 180f8cf

File tree

10 files changed

+81
-76
lines changed

10 files changed

+81
-76
lines changed

.docker/clickhouse/cluster/server1_config.xml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,11 @@
9090
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
9191
</query_log>
9292

93-
<http_options_response>
94-
<header>
95-
<name>Access-Control-Allow-Origin</name>
96-
<value>*</value>
97-
</header>
98-
<header>
99-
<name>Access-Control-Allow-Headers</name>
100-
<value>accept, origin, x-requested-with, content-type, authorization</value>
101-
</header>
102-
<header>
103-
<name>Access-Control-Allow-Methods</name>
104-
<value>POST, GET, OPTIONS</value>
105-
</header>
106-
<header>
107-
<name>Access-Control-Max-Age</name>
108-
<value>86400</value>
109-
</header>
110-
</http_options_response>
93+
<!-- required after 25.1+ -->
94+
<format_schema_path>/var/lib/clickhouse/format_schemas/</format_schema_path>
95+
<user_directories>
96+
<users_xml>
97+
<path>users.xml</path>
98+
</users_xml>
99+
</user_directories>
111100
</clickhouse>

.docker/clickhouse/cluster/server2_config.xml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,11 @@
9090
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
9191
</query_log>
9292

93-
<http_options_response>
94-
<header>
95-
<name>Access-Control-Allow-Origin</name>
96-
<value>*</value>
97-
</header>
98-
<header>
99-
<name>Access-Control-Allow-Headers</name>
100-
<value>accept, origin, x-requested-with, content-type, authorization</value>
101-
</header>
102-
<header>
103-
<name>Access-Control-Allow-Methods</name>
104-
<value>POST, GET, OPTIONS</value>
105-
</header>
106-
<header>
107-
<name>Access-Control-Max-Age</name>
108-
<value>86400</value>
109-
</header>
110-
</http_options_response>
93+
<!-- required after 25.1+ -->
94+
<format_schema_path>/var/lib/clickhouse/format_schemas/</format_schema_path>
95+
<user_directories>
96+
<users_xml>
97+
<path>users.xml</path>
98+
</users_xml>
99+
</user_directories>
111100
</clickhouse>

.docker/clickhouse/single_node/config.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,11 @@
3232
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
3333
</query_log>
3434

35+
<!-- required after 25.1+ -->
36+
<format_schema_path>/var/lib/clickhouse/format_schemas/</format_schema_path>
37+
<user_directories>
38+
<users_xml>
39+
<path>users.xml</path>
40+
</users_xml>
41+
</user_directories>
3542
</clickhouse>

.docker/clickhouse/single_node_tls/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM clickhouse/clickhouse-server:24.7-alpine
1+
FROM clickhouse/clickhouse-server:25.2-alpine
22
COPY .docker/clickhouse/single_node_tls/certificates /etc/clickhouse-server/certs
33
RUN chown clickhouse:clickhouse -R /etc/clickhouse-server/certs \
44
&& chmod 600 /etc/clickhouse-server/certs/* \

.docker/clickhouse/single_node_tls/config.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,12 @@
4343
<partition_by>toYYYYMM(event_date)</partition_by>
4444
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
4545
</query_log>
46+
47+
<!-- required after 25.1+ -->
48+
<format_schema_path>/var/lib/clickhouse/format_schemas/</format_schema_path>
49+
<user_directories>
50+
<users_xml>
51+
<path>users.xml</path>
52+
</users_xml>
53+
</user_directories>
4654
</clickhouse>

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Bug fixes
44

5-
* Update clickhouse-client to 0.8.1 to fix errors in queries with CTEs ([#297](https://github.com/ClickHouse/metabase-clickhouse-driver/issues/297), [#288](https://github.com/ClickHouse/metabase-clickhouse-driver/issues/288), [tadeboro](https://github.com/tadeboro)).
5+
* The JDBC driver was updated to [0.8.1](https://github.com/ClickHouse/clickhouse-java/releases/tag/v0.8.1) to fix errors in queries with CTEs ([#297](https://github.com/ClickHouse/metabase-clickhouse-driver/issues/297), [#288](https://github.com/ClickHouse/metabase-clickhouse-driver/issues/288), [tadeboro](https://github.com/tadeboro)).
66

77
# 1.53.1
88

README.md

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,11 @@
2424

2525
The driver aims to support the current stable and LTS releases (see [the related docs](https://clickhouse.com/docs/en/faq/operations/production#how-to-choose-between-clickhouse-releases)).
2626

27-
After 1.50.1:
28-
2927
| ClickHouse version | Supported? |
3028
|-------------------------|-------------|
3129
| 23.8+ ||
3230
| 23.6 - 23.7 | Best effort |
3331

34-
1.50.0 and earlier:
35-
36-
| ClickHouse version | Supported? |
37-
|-------------------------|-------------|
38-
| 23.8+ ||
39-
| 23.3 - 23.7 | Best effort |
40-
4132
For [connection impersonation feature](https://www.metabase.com/learn/permissions/impersonation), the minimal required ClickHouse version is 24.4; otherwise, the feature is disabled by the driver.
4233

4334
The [CSV Uploads feature](https://www.metabase.com/docs/latest/databases/uploads) currently works only with ClickHouse Cloud (see [this issue](https://github.com/ClickHouse/metabase-clickhouse-driver/issues/230) for more details).
@@ -54,11 +45,11 @@ The [CSV Uploads feature](https://www.metabase.com/docs/latest/databases/uploads
5445
6. Make sure you are the in the directory where your `metabase.jar` lives.
5546
7. Run `MB_PLUGINS_DIR=./plugins; java -jar metabase.jar`.
5647

57-
For example [(using Metabase v0.51.1.2 and ClickHouse driver 1.51.0)](#choosing-the-right-version):
48+
For example [(using Metabase v0.53 and ClickHouse driver 1.53.2)](#choosing-the-right-version):
5849

5950
```bash
60-
export METABASE_VERSION=v0.51.1.2
61-
export METABASE_CLICKHOUSE_DRIVER_VERSION=1.51.0
51+
export METABASE_VERSION=v0.53.x
52+
export METABASE_CLICKHOUSE_DRIVER_VERSION=1.53.2
6253

6354
mkdir -p mb/plugins && cd mb
6455
curl -o metabase.jar https://downloads.metabase.com/$METABASE_VERSION/metabase.jar
@@ -68,11 +59,11 @@ MB_PLUGINS_DIR=./plugins; java -jar metabase.jar
6859

6960
### Run as a Docker container
7061

71-
Alternatively, if you don't want to run Metabase Jar, you can use a Docker image:
62+
Alternatively, if you don't want to run Metabase from a jar, you can use a Docker image:
7263

7364
```bash
74-
export METABASE_VERSION=v0.51.1.2
75-
export METABASE_CLICKHOUSE_DRIVER_VERSION=1.51.0
65+
export METABASE_VERSION=v0.53.x
66+
export METABASE_CLICKHOUSE_DRIVER_VERSION=1.53.2
7667

7768
mkdir -p mb/plugins && cd mb
7869
curl -L -o plugins/ch.jar https://github.com/ClickHouse/metabase-clickhouse-driver/releases/download/$METABASE_CLICKHOUSE_DRIVER_VERSION/clickhouse.metabase-driver.jar
@@ -85,36 +76,22 @@ docker run -d -p 3000:3000 \
8576

8677
| Metabase Release | Driver Version |
8778
| ---------------- | -------------- |
88-
| 0.33.x | 0.6 |
89-
| 0.34.x | 0.7.0 |
90-
| 0.35.x | 0.7.1 |
91-
| 0.37.3 | 0.7.3 |
92-
| 0.38.1+ | 0.7.5 |
93-
| 0.41.2 | 0.8.0 |
94-
| 0.41.3.1 | 0.8.1 |
95-
| 0.42.x | 0.8.1 |
96-
| 0.44.x | 0.9.1 |
97-
| 0.45.x | 1.1.0 |
98-
| 0.46.x | 1.1.7 |
99-
| 0.47.x | 1.2.3 |
100-
| 0.47.7+ | 1.2.5 |
101-
| 0.48.x | 1.3.4 |
102-
| 0.49.x | 1.4.0 |
103-
| 0.49.14+ | 1.5.1 |
10479
| 0.50.x | 1.50.7 |
10580
| 0.51.x | 1.51.0 |
81+
| 0.52.x | 1.52.0 |
82+
| 0.53.x | 1.53.2 |
10683

107-
After Metabase 0.50.0, a new naming convention exists for the driver's releases. The new one is intended to reflect the Metabase version the driver is supposed to run on. For example, the driver version 1.50.0 means that it should be used with Metabase v0.50.x or Metabase EE 1.50.x _only_, and it is _not guaranteed_ that this particular version of the driver can work with the previous or the following versions of Metabase.
84+
The minor version of the driver should always match the minor version of the Metabase release. For example, the driver version 1.**50**.0 means that it should be used with Metabase v0.**50**.x or Metabase EE 1.**50**.x _only_, and it is _not guaranteed_ that this particular version of the driver can work with the previous or the following versions of Metabase.
10885

10986
## Creating a Metabase Docker image with ClickHouse driver
11087

11188
You can use a convenience script `build_docker_image.sh`, which takes three arguments: Metabase version, ClickHouse driver version, and the desired final Docker image tag.
11289

11390
```bash
114-
./build_docker_image.sh v0.51.1.2 1.51.0 my-metabase-with-clickhouse:v0.0.1
91+
./build_docker_image.sh v0.53.x 1.53.2 my-metabase-with-clickhouse:v0.0.1
11592
```
11693

117-
where `v0.51.1.2` is Metabase version, `1.51.0` is ClickHouse driver version, and `my-metabase-with-clickhouse:v0.0.1` being the tag.
94+
where `v0.53.x` is Metabase version, `1.53.2` is ClickHouse driver version, and `my-metabase-with-clickhouse:v0.0.1` being the tag.
11895

11996
Then you should be able to run it:
12097

docker-compose.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ services:
55
##########################################################################################################
66

77
clickhouse:
8-
image: 'clickhouse/clickhouse-server:24.7-alpine'
8+
image: 'clickhouse/clickhouse-server:25.2-alpine'
99
container_name: 'metabase-driver-clickhouse-server'
1010
hostname: clickhouse
1111
ports:
1212
- '8123:8123'
1313
- '9000:9000'
14+
environment:
15+
CLICKHOUSE_SKIP_USER_SETUP: 1
1416
ulimits:
1517
nofile:
1618
soft: 262144
@@ -31,6 +33,8 @@ services:
3133
ports:
3234
- '8443:8443'
3335
- '9440:9440'
36+
environment:
37+
CLICKHOUSE_SKIP_USER_SETUP: 1
3438
ulimits:
3539
nofile:
3640
soft: 262144
@@ -52,6 +56,8 @@ services:
5256
ports:
5357
- '8124:8123'
5458
- '9001:9000'
59+
environment:
60+
CLICKHOUSE_SKIP_USER_SETUP: 1
5561
ulimits:
5662
nofile:
5763
soft: 262144
@@ -66,7 +72,7 @@ services:
6672
##########################################################################################################
6773

6874
clickhouse_cluster_node1:
69-
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.7-alpine}'
75+
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-25.2-alpine}'
7076
ulimits:
7177
nofile:
7278
soft: 262144
@@ -77,13 +83,15 @@ services:
7783
- '8125:8123'
7884
- '9002:9000'
7985
- '9181:9181'
86+
environment:
87+
CLICKHOUSE_SKIP_USER_SETUP: 1
8088
volumes:
8189
- './.docker/clickhouse/cluster/server1_config.xml:/etc/clickhouse-server/config.xml'
8290
- './.docker/clickhouse/cluster/server1_macros.xml:/etc/clickhouse-server/config.d/macros.xml'
8391
- './.docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml'
8492

8593
clickhouse_cluster_node2:
86-
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.7-alpine}'
94+
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-25.2-alpine}'
8795
ulimits:
8896
nofile:
8997
soft: 262144
@@ -94,6 +102,8 @@ services:
94102
- '8126:8123'
95103
- '9003:9000'
96104
- '9182:9181'
105+
environment:
106+
CLICKHOUSE_SKIP_USER_SETUP: 1
97107
volumes:
98108
- './.docker/clickhouse/cluster/server2_config.xml:/etc/clickhouse-server/config.xml'
99109
- './.docker/clickhouse/cluster/server2_macros.xml:/etc/clickhouse-server/config.d/macros.xml'
@@ -115,7 +125,7 @@ services:
115125
##########################################################################################################
116126

117127
metabase:
118-
image: metabase/metabase-enterprise:v1.52.2.5
128+
image: metabase/metabase-enterprise:v1.53.6.4
119129
container_name: metabase-with-clickhouse-driver
120130
hostname: metabase
121131
environment:

test/metabase/driver/clickhouse_data_types_test.clj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,3 +564,18 @@
564564
(data/run-mbql-query
565565
unsigned_int_types
566566
{})))))))))
567+
568+
;; FIXME: blocked by https://github.com/ClickHouse/clickhouse-java/issues/2218
569+
#_(deftest ^:parallel clickhouse-fixed-strings
570+
(mt/test-driver
571+
:clickhouse
572+
(is (= [["val1" "val2" "val3" "val4"]]
573+
(qp.test/formatted-rows
574+
[str str str str]
575+
:format-nil-values
576+
(ctd/do-with-test-db
577+
(fn [db]
578+
(data/with-db db
579+
(data/run-mbql-query
580+
fixed_strings
581+
{})))))))))

test/metabase/test/data/clickhouse_datasets.sql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,13 @@ CREATE TABLE `metabase_test`.`unsigned_int_types`
279279
) ENGINE Memory;
280280
INSERT INTO `metabase_test`.`unsigned_int_types`
281281
VALUES (255, 65535, 4294967295, 18446744073709551615);
282+
283+
CREATE TABLE `metabase_test`.`fixed_strings`
284+
(
285+
`f1` FixedString(4),
286+
`f2` LowCardinality(FixedString(4)),
287+
`f3` Nullable(FixedString(4)),
288+
`f4` LowCardinality(Nullable(FixedString(4)))
289+
) ENGINE Memory;
290+
INSERT INTO `metabase_test`.`fixed_strings`
291+
VALUES ('val1', 'val2', 'val3', 'val4');

0 commit comments

Comments
 (0)