Adding upstream version 18.17.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
fc6bad5705
commit
03001ce1e6
90 changed files with 46581 additions and 43319 deletions
|
@ -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={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue