Merging upstream version 25.20.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
d9afe6504e
commit
f9e1084cc5
119 changed files with 78094 additions and 71498 deletions
|
@ -159,6 +159,27 @@ class TestClickhouse(Validator):
|
|||
"SELECT SUM(1) AS impressions FROM (SELECT ['Istanbul', 'Berlin', 'Bobruisk'] AS cities) WHERE arrayJoin(cities) IN ('Istanbul', 'Berlin')",
|
||||
)
|
||||
|
||||
self.validate_all(
|
||||
"char(67) || char(65) || char(84)",
|
||||
read={
|
||||
"clickhouse": "char(67) || char(65) || char(84)",
|
||||
"oracle": "chr(67) || chr(65) || chr(84)",
|
||||
},
|
||||
)
|
||||
self.validate_all(
|
||||
"SELECT lagInFrame(salary, 1, 0) OVER (ORDER BY hire_date) AS prev_sal FROM employees",
|
||||
read={
|
||||
"clickhouse": "SELECT lagInFrame(salary, 1, 0) OVER (ORDER BY hire_date) AS prev_sal FROM employees",
|
||||
"oracle": "SELECT LAG(salary, 1, 0) OVER (ORDER BY hire_date) AS prev_sal FROM employees",
|
||||
},
|
||||
)
|
||||
self.validate_all(
|
||||
"SELECT leadInFrame(salary, 1, 0) OVER (ORDER BY hire_date) AS prev_sal FROM employees",
|
||||
read={
|
||||
"clickhouse": "SELECT leadInFrame(salary, 1, 0) OVER (ORDER BY hire_date) AS prev_sal FROM employees",
|
||||
"oracle": "SELECT LEAD(salary, 1, 0) OVER (ORDER BY hire_date) AS prev_sal FROM employees",
|
||||
},
|
||||
)
|
||||
self.validate_all(
|
||||
"SELECT CAST(STR_TO_DATE('05 12 2000', '%d %m %Y') AS DATE)",
|
||||
read={
|
||||
|
@ -494,6 +515,7 @@ class TestClickhouse(Validator):
|
|||
)
|
||||
self.validate_identity("SELECT TRIM(TRAILING ')' FROM '( Hello, world! )')")
|
||||
self.validate_identity("SELECT TRIM(LEADING '(' FROM '( Hello, world! )')")
|
||||
self.validate_identity("current_timestamp").assert_is(exp.Column)
|
||||
|
||||
def test_clickhouse_values(self):
|
||||
values = exp.select("*").from_(
|
||||
|
@ -995,6 +1017,12 @@ LIFETIME(MIN 0 MAX 0)""",
|
|||
pretty=True,
|
||||
)
|
||||
|
||||
self.assertIsNotNone(
|
||||
self.validate_identity("CREATE TABLE t1 (a String MATERIALIZED func())").find(
|
||||
exp.ColumnConstraint
|
||||
)
|
||||
)
|
||||
|
||||
def test_agg_functions(self):
|
||||
def extract_agg_func(query):
|
||||
return parse_one(query, read="clickhouse").selects[0].this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue