summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_clickhouse.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dialects/test_clickhouse.py')
-rw-r--r--tests/dialects/test_clickhouse.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/dialects/test_clickhouse.py b/tests/dialects/test_clickhouse.py
index 53cd0a9..b4ba09e 100644
--- a/tests/dialects/test_clickhouse.py
+++ b/tests/dialects/test_clickhouse.py
@@ -492,6 +492,8 @@ class TestClickhouse(Validator):
"postgres": "INSERT INTO t (col1, col2) VALUES ('abcd', 1234)",
},
)
+ self.validate_identity("SELECT TRIM(TRAILING ')' FROM '( Hello, world! )')")
+ self.validate_identity("SELECT TRIM(LEADING '(' FROM '( Hello, world! )')")
def test_clickhouse_values(self):
values = exp.select("*").from_(
@@ -620,6 +622,14 @@ class TestClickhouse(Validator):
)
self.assertEqual(create_with_cluster.sql("clickhouse"), "CREATE DATABASE foo ON CLUSTER c")
+ # Transpiled CREATE SCHEMA may have OnCluster property set
+ create_with_cluster = exp.Create(
+ this=db_table_expr,
+ kind="SCHEMA",
+ properties=exp.Properties(expressions=[exp.OnCluster(this=exp.to_identifier("c"))]),
+ )
+ self.assertEqual(create_with_cluster.sql("clickhouse"), "CREATE DATABASE foo ON CLUSTER c")
+
ctas_with_comment = exp.Create(
this=exp.table_("foo"),
kind="TABLE",