From 3543dfcb80449ef8818a46dc08c637ff6f8bf5ff Mon Sep 17 00:00:00 2001 From: Chris Truter Date: Tue, 1 Oct 2024 11:38:41 +0200 Subject: [PATCH] Whitespace --- src/metabase/driver/clickhouse.clj | 15 +++++++-------- .../driver/clickhouse_impersonation_test.clj | 6 +++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/metabase/driver/clickhouse.clj b/src/metabase/driver/clickhouse.clj index bcfa9cc..dcfd73a 100644 --- a/src/metabase/driver/clickhouse.clj +++ b/src/metabase/driver/clickhouse.clj @@ -220,13 +220,13 @@ (defn- create-table!-sql "Creates a ClickHouse table with the given name and column definitions. It assumes the engine is MergeTree, so it only works with Clickhouse Cloud and single node on-premise deployments at the moment." - [driver table-name column-definitions & {:keys [primary-key] :as opts}] + [_driver table-name column-definitions & {:keys [primary-key] :as opts}] (str/join "\n" - [(#'sql-jdbc/create-table!-sql :sql-jdbc table-name column-definitions opts) - "ENGINE = MergeTree" - (format "ORDER BY (%s)" (str/join ", " (map quote-name primary-key))) - ;; disable insert idempotency to allow duplicate inserts - "SETTINGS replicated_deduplication_window = 0"])) + [(#'sql-jdbc/create-table!-sql :sql-jdbc table-name column-definitions opts) + "ENGINE = MergeTree" + (format "ORDER BY (%s)" (str/join ", " (map quote-name primary-key))) + ;; disable insert idempotency to allow duplicate inserts + "SETTINGS replicated_deduplication_window = 0"])) (defmethod driver/create-table! :clickhouse [driver db-id table-name column-definitions & {:keys [primary-key]}] @@ -290,8 +290,7 @@ quoted-role (->> (clojure.string/split role #",") (map quote-if-needed) (clojure.string/join ","))] - (format "SET ROLE %s;" quoted-role)) - ) + (format "SET ROLE %s;" quoted-role))) (defmethod driver.sql/default-database-role :clickhouse [_ _] diff --git a/test/metabase/driver/clickhouse_impersonation_test.clj b/test/metabase/driver/clickhouse_impersonation_test.clj index 6e8c8be..ec37ac6 100644 --- a/test/metabase/driver/clickhouse_impersonation_test.clj +++ b/test/metabase/driver/clickhouse_impersonation_test.clj @@ -31,9 +31,9 @@ (is true)) (testing "does not throw with a role containing hyphens" (sql-jdbc.execute/do-with-connection-with-options - :clickhouse spec nil - (fn [^java.sql.Connection conn] - (driver/set-role! :clickhouse conn "metabase-test-role"))) + :clickhouse spec nil + (fn [^java.sql.Connection conn] + (driver/set-role! :clickhouse conn "metabase-test-role"))) (is true)) (testing "does not throw with the default role" (sql-jdbc.execute/do-with-connection-with-options