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.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/dialects/test_clickhouse.py b/tests/dialects/test_clickhouse.py
new file mode 100644
index 0000000..e5b1516
--- /dev/null
+++ b/tests/dialects/test_clickhouse.py
@@ -0,0 +1,25 @@
+from tests.dialects.test_dialect import Validator
+
+
+class TestClickhouse(Validator):
+ dialect = "clickhouse"
+
+ def test_clickhouse(self):
+ self.validate_identity("dictGet(x, 'y')")
+ self.validate_identity("SELECT * FROM x FINAL")
+ self.validate_identity("SELECT * FROM x AS y FINAL")
+
+ self.validate_all(
+ "SELECT fname, lname, age FROM person ORDER BY age DESC NULLS FIRST, fname ASC NULLS LAST, lname",
+ write={
+ "clickhouse": "SELECT fname, lname, age FROM person ORDER BY age DESC NULLS FIRST, fname, lname",
+ "spark": "SELECT fname, lname, age FROM person ORDER BY age DESC NULLS FIRST, fname NULLS LAST, lname NULLS LAST",
+ },
+ )
+
+ self.validate_all(
+ "CAST(1 AS NULLABLE(Int64))",
+ write={
+ "clickhouse": "CAST(1 AS Nullable(BIGINT))",
+ },
+ )