From b79669ae555f5b060ef42dc14a3d6372cd418b33 Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 22 Oct 2023 00:11:27 +0100 Subject: [PATCH] cluster names containing dash characters (#198) (#200) Co-authored-by: the4thamigo-uk --- dbt/adapters/clickhouse/dbclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/adapters/clickhouse/dbclient.py b/dbt/adapters/clickhouse/dbclient.py index 2ad197ba..320ea566 100644 --- a/dbt/adapters/clickhouse/dbclient.py +++ b/dbt/adapters/clickhouse/dbclient.py @@ -150,7 +150,7 @@ def _ensure_database(self, database_engine, cluster_name) -> None: db_exists = self.command(check_db) if not db_exists: engine_clause = f' ENGINE {database_engine} ' if database_engine else '' - cluster_clause = f' ON CLUSTER {cluster_name} ' if cluster_name is not None else '' + cluster_clause = f' ON CLUSTER "{cluster_name}" ' if cluster_name is not None else '' self.command(f'CREATE DATABASE {self.database}{cluster_clause}{engine_clause}') db_exists = self.command(check_db) if not db_exists: