Skip to content

Commit

Permalink
Remove allow_experimental_analyzer=0 setting (#261)
Browse files Browse the repository at this point in the history
* Remove `allow_experimental_analyzer=0` setting

* Bump version, update CHANGELOG
  • Loading branch information
slvrtrn committed Aug 8, 2024
1 parent 562c1e1 commit 01ecc5f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .docker/clickhouse/single_node_tls/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM clickhouse/clickhouse-server:24.5-alpine
FROM clickhouse/clickhouse-server:24.7-alpine
COPY .docker/clickhouse/single_node_tls/certificates /etc/clickhouse-server/certs
RUN chown clickhouse:clickhouse -R /etc/clickhouse-server/certs \
&& chmod 600 /etc/clickhouse-server/certs/* \
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.50.3

### Improvements

* The driver no longer explicitly sets `allow_experimental_analyzer=0` settings on the connection level; the [new ClickHouse analyzer](https://clickhouse.com/docs/en/operations/analyzer) is now enabled by default.

# 1.50.2

### Bug fixes
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
##########################################################################################################

clickhouse:
image: 'clickhouse/clickhouse-server:24.5-alpine'
image: 'clickhouse/clickhouse-server:24.7-alpine'
container_name: 'metabase-driver-clickhouse-server'
hostname: clickhouse
ports:
Expand Down Expand Up @@ -66,7 +66,7 @@ services:
##########################################################################################################

clickhouse_cluster_node1:
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.5-alpine}'
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.7-alpine}'
ulimits:
nofile:
soft: 262144
Expand All @@ -83,7 +83,7 @@ services:
- './.docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml'

clickhouse_cluster_node2:
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.5-alpine}'
image: 'clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-24.7-alpine}'
ulimits:
nofile:
soft: 262144
Expand Down
2 changes: 1 addition & 1 deletion resources/metabase-plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
info:
name: Metabase ClickHouse Driver
version: 1.50.2
version: 1.50.3
description: Allows Metabase to connect to ClickHouse databases.
contact-info:
name: ClickHouse
Expand Down
13 changes: 5 additions & 8 deletions src/metabase/driver/clickhouse.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(driver/register! :clickhouse :parent #{:sql-jdbc})

(defmethod driver/display-name :clickhouse [_] "ClickHouse")
(def ^:private product-name "metabase/1.50.2")
(def ^:private product-name "metabase/1.50.3")

(defmethod driver/prettify-native-form :clickhouse
[_ native-form]
Expand Down Expand Up @@ -74,9 +74,7 @@
;; and https://github.com/ClickHouse/clickhouse-java/issues/1634#issuecomment-2110392634
:databaseTerm "schema"
:remember_last_set_roles true
:http_connection_provider "HTTP_URL_CONNECTION"
;; See https://github.com/ClickHouse/ClickHouse/issues/64487
:custom_http_params "allow_experimental_analyzer=0"}
:http_connection_provider "HTTP_URL_CONNECTION"}
(sql-jdbc.common/handle-additional-options details :separator-style :url))))

(defmethod sql-jdbc.execute/do-with-connection-with-options :clickhouse
Expand All @@ -87,10 +85,9 @@
options
(fn [^java.sql.Connection conn]
(when-not (sql-jdbc.execute/recursive-connection?)
(let [settings (if session-timezone
(format "allow_experimental_analyzer=0,session_timezone=%s" session-timezone)
"allow_experimental_analyzer=0")]
(.setClientInfo conn com.clickhouse.jdbc.ClickHouseConnection/PROP_CUSTOM_HTTP_PARAMS settings))
(when session-timezone
(.setClientInfo conn com.clickhouse.jdbc.ClickHouseConnection/PROP_CUSTOM_HTTP_PARAMS
(format "session_timezone=%s" session-timezone)))

(sql-jdbc.execute/set-best-transaction-level! driver conn)
(sql-jdbc.execute/set-time-zone-if-supported! driver conn session-timezone)
Expand Down
5 changes: 2 additions & 3 deletions test/metabase/test/data/clickhouse.clj
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@
:ssl false
:use_no_proxy false
:use_server_time_zone_for_dates true
:product_name "metabase/1.50.2"
:product_name "metabase/1.50.3"
:databaseTerm "schema"
:remember_last_set_roles true
:http_connection_provider "HTTP_URL_CONNECTION"
:custom_http_params "allow_experimental_analyzer=0"})
:http_connection_provider "HTTP_URL_CONNECTION"})

;; (def ^:private time-type-comment "COMMENT 'time'")
;; (def ^:private time-type (format "DateTime64(3) %s" time-type-comment))
Expand Down

0 comments on commit 01ecc5f

Please sign in to comment.