summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_clickhouse.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 17:08:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-30 17:08:33 +0000
commit75d158890b303b701c51f12b34c422fb823ba9aa (patch)
tree5f10a4a1eb612918ea94a934cfc9b9893ea19442 /tests/dialects/test_clickhouse.py
parentAdding upstream version 10.5.6. (diff)
downloadsqlglot-75d158890b303b701c51f12b34c422fb823ba9aa.tar.xz
sqlglot-75d158890b303b701c51f12b34c422fb823ba9aa.zip
Adding upstream version 10.5.10.upstream/10.5.10
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_clickhouse.py')
-rw-r--r--tests/dialects/test_clickhouse.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/dialects/test_clickhouse.py b/tests/dialects/test_clickhouse.py
index 2827dd4..905e1f4 100644
--- a/tests/dialects/test_clickhouse.py
+++ b/tests/dialects/test_clickhouse.py
@@ -17,7 +17,8 @@ class TestClickhouse(Validator):
self.validate_identity("SELECT quantile(0.5)(a)")
self.validate_identity("SELECT quantiles(0.5)(a) AS x FROM t")
self.validate_identity("SELECT * FROM foo WHERE x GLOBAL IN (SELECT * FROM bar)")
- self.validate_identity("position(a, b)")
+ self.validate_identity("position(haystack, needle)")
+ self.validate_identity("position(haystack, needle, position)")
self.validate_all(
"SELECT fname, lname, age FROM person ORDER BY age DESC NULLS FIRST, fname ASC NULLS LAST, lname",
@@ -48,6 +49,10 @@ class TestClickhouse(Validator):
"clickhouse": "SELECT quantileIf(0.5)(a, TRUE)",
},
)
+ self.validate_all(
+ "SELECT position(needle IN haystack)",
+ write={"clickhouse": "SELECT position(haystack, needle)"},
+ )
def test_cte(self):
self.validate_identity("WITH 'x' AS foo SELECT foo")