1
0
Fork 0

Merging upstream version 18.17.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:09:41 +01:00
parent fdf9ca761f
commit 04c9be45a8
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
90 changed files with 46581 additions and 43319 deletions

View file

@ -6,6 +6,22 @@ class TestClickhouse(Validator):
dialect = "clickhouse"
def test_clickhouse(self):
self.validate_identity("x <> y")
self.validate_all(
"has([1], x)",
read={
"postgres": "x = any(array[1])",
},
)
self.validate_all(
"NOT has([1], x)",
read={
"postgres": "any(array[1]) <> x",
},
)
self.validate_identity("x = y")
string_types = [
"BLOB",
"LONGBLOB",
@ -85,6 +101,39 @@ class TestClickhouse(Validator):
"CREATE MATERIALIZED VIEW test_view (id UInt8) TO db.table1 AS SELECT * FROM test_data"
)
self.validate_all(
"SELECT CAST('2020-01-01' AS TIMESTAMP) + INTERVAL '500' microsecond",
read={
"duckdb": "SELECT TIMESTAMP '2020-01-01' + INTERVAL '500 us'",
"postgres": "SELECT TIMESTAMP '2020-01-01' + INTERVAL '500 us'",
},
)
self.validate_all(
"SELECT CURRENT_DATE()",
read={
"clickhouse": "SELECT CURRENT_DATE()",
"postgres": "SELECT CURRENT_DATE",
},
)
self.validate_all(
"SELECT CURRENT_TIMESTAMP()",
read={
"clickhouse": "SELECT CURRENT_TIMESTAMP()",
"postgres": "SELECT CURRENT_TIMESTAMP",
},
)
self.validate_all(
"SELECT match('ThOmAs', CONCAT('(?i)', 'thomas'))",
read={
"postgres": "SELECT 'ThOmAs' ~* 'thomas'",
},
)
self.validate_all(
"SELECT match('ThOmAs', CONCAT('(?i)', x)) FROM t",
read={
"postgres": "SELECT 'ThOmAs' ~* x FROM t",
},
)
self.validate_all(
"SELECT '\\0'",
read={