Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Turn off db routing for clickhouse and it's trick. (#65984)

dpsuttona8e592718f3f
diff --git a/modules/drivers/clickhouse/src/metabase/driver/clickhouse.clj b/modules/drivers/clickhouse/src/metabase/driver/clickhouse.clj
index 8f80777c466..98bd56ab095 100644
--- a/modules/drivers/clickhouse/src/metabase/driver/clickhouse.clj
+++ b/modules/drivers/clickhouse/src/metabase/driver/clickhouse.clj
@@ -55,7 +55,7 @@
:rename true
:actions false
:metadata/key-constraints false
- :database-routing true
+ :database-routing false
:transforms/python true
:transforms/table true
;; JDBC driver always provides "NO" for the IS_GENERATEDCOLUMN JDBC metadata
diff --git a/modules/drivers/clickhouse/src/metabase/driver/clickhouse_introspection.clj b/modules/drivers/clickhouse/src/metabase/driver/clickhouse_introspection.clj
index a6a6f177936..ad509c3c8ff 100644
--- a/modules/drivers/clickhouse/src/metabase/driver/clickhouse_introspection.clj
+++ b/modules/drivers/clickhouse/src/metabase/driver/clickhouse_introspection.clj
@@ -158,7 +158,6 @@
jdbc/metadata-result))))
(filter not-inner-mv-table?)
(tables-set)
- (map #(assoc % :schema nil))
(set)))
(defmethod driver/describe-database* :clickhouse
diff --git a/modules/drivers/clickhouse/test/metabase/driver/clickhouse_introspection_test.clj b/modules/drivers/clickhouse/test/metabase/driver/clickhouse_introspection_test.clj
index 0ded6005f08..32fde0e794d 100644
--- a/modules/drivers/clickhouse/test/metabase/driver/clickhouse_introspection_test.clj
+++ b/modules/drivers/clickhouse/test/metabase/driver/clickhouse_introspection_test.clj
@@ -542,26 +542,3 @@
;; tables from `information_schema`
(is (contains? tables tables-table))
(is (contains? tables columns-table)))))))
-
-(deftest ^:parallel clickhouse-describe-database-enable-multiple-db-schema-test
- (mt/test-driver :clickhouse
- (let [tables-with-schema {:tables
- #{{:name "users", :schema "test_data", :description nil}
- {:name "venues", :schema "test_data", :description nil}
- {:name "categories", :schema "test_data", :description nil}
- {:name "checkins", :schema "test_data", :description nil}
- {:name "orders", :schema "test_data", :description nil}
- {:name "people", :schema "test_data", :description nil}
- {:name "products", :schema "test_data", :description nil}
- {:name "reviews", :schema "test_data", :description nil}}}]
- (testing "when the enable-multiple-db is true describe-database returns tables with the db/schema"
- (is (= tables-with-schema
- (driver/describe-database driver/*driver* (mt/db)))))
- (testing "when the enable-multiple-db is false describe-database returns tables without the db/schema"
- (mt/with-temp [:model/Database db {:engine :clickhouse,
- :details (assoc (:details (mt/db))
- :enable-multiple-db false
- :db-filters-type nil
- :db-filters-patterns nil)}]
- (is (= {:tables (set (map #(assoc % :schema nil) (:tables tables-with-schema)))}
- (driver/describe-database driver/*driver* db))))))))