Adding upstream version 26.8.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
4b797b16f0
commit
4c394df415
61 changed files with 43883 additions and 41898 deletions
|
@ -314,6 +314,10 @@ class TestDuckDB(Validator):
|
|||
self.validate_identity(
|
||||
"""SELECT '{ "family": "anatidae", "species": [ "duck", "goose", "swan", null ] }' ->> ['$.family', '$.species']""",
|
||||
)
|
||||
self.validate_identity(
|
||||
"SELECT 20_000 AS literal",
|
||||
"SELECT 20000 AS literal",
|
||||
)
|
||||
self.validate_identity(
|
||||
"""SELECT JSON_EXTRACT_STRING('{ "family": "anatidae", "species": [ "duck", "goose", "swan", null ] }', ['$.family', '$.species'])""",
|
||||
"""SELECT '{ "family": "anatidae", "species": [ "duck", "goose", "swan", null ] }' ->> ['$.family', '$.species']""",
|
||||
|
@ -403,6 +407,14 @@ class TestDuckDB(Validator):
|
|||
self.validate_all("0x1010", write={"": "0 AS x1010"})
|
||||
self.validate_all("x ~ y", write={"duckdb": "REGEXP_MATCHES(x, y)"})
|
||||
self.validate_all("SELECT * FROM 'x.y'", write={"duckdb": 'SELECT * FROM "x.y"'})
|
||||
self.validate_all(
|
||||
"COUNT_IF(x)",
|
||||
write={
|
||||
"duckdb": "COUNT_IF(x)",
|
||||
"duckdb, version=1.0": "SUM(CASE WHEN x THEN 1 ELSE 0 END)",
|
||||
"duckdb, version=1.2": "COUNT_IF(x)",
|
||||
},
|
||||
)
|
||||
self.validate_all(
|
||||
"SELECT STRFTIME(CAST('2020-01-01' AS TIMESTAMP), CONCAT('%Y', '%m'))",
|
||||
write={
|
||||
|
@ -410,6 +422,13 @@ class TestDuckDB(Validator):
|
|||
"tsql": "SELECT FORMAT(CAST('2020-01-01' AS DATETIME2), CONCAT('yyyy', 'MM'))",
|
||||
},
|
||||
)
|
||||
self.validate_all(
|
||||
"""SELECT CAST('{"x": 1}' AS JSON)""",
|
||||
read={
|
||||
"duckdb": """SELECT '{"x": 1}'::JSON""",
|
||||
"postgres": """SELECT '{"x": 1}'::JSONB""",
|
||||
},
|
||||
)
|
||||
self.validate_all(
|
||||
"SELECT * FROM produce PIVOT(SUM(sales) FOR quarter IN ('Q1', 'Q2'))",
|
||||
read={
|
||||
|
@ -910,6 +929,10 @@ class TestDuckDB(Validator):
|
|||
"postgres": "SELECT 'ThOmAs' ~* 'thomas'",
|
||||
},
|
||||
)
|
||||
self.validate_identity(
|
||||
"SELECT DATE_ADD(CAST('2020-01-01' AS DATE), INTERVAL 1 DAY)",
|
||||
"SELECT CAST('2020-01-01' AS DATE) + INTERVAL '1' DAY",
|
||||
)
|
||||
|
||||
def test_array_index(self):
|
||||
with self.assertLogs(helper_logger) as cm:
|
||||
|
@ -929,15 +952,15 @@ class TestDuckDB(Validator):
|
|||
)
|
||||
self.validate_identity(
|
||||
"""SELECT LIST_VALUE(1)[i]""",
|
||||
"""SELECT ([1])[i]""",
|
||||
"""SELECT [1][i]""",
|
||||
)
|
||||
self.validate_identity(
|
||||
"""{'x': LIST_VALUE(1)[i]}""",
|
||||
"""{'x': ([1])[i]}""",
|
||||
"""{'x': [1][i]}""",
|
||||
)
|
||||
self.validate_identity(
|
||||
"""SELECT LIST_APPLY(RANGE(1, 4), i -> {'f1': LIST_VALUE(1, 2, 3)[i], 'f2': LIST_VALUE(1, 2, 3)[i]})""",
|
||||
"""SELECT LIST_APPLY(RANGE(1, 4), i -> {'f1': ([1, 2, 3])[i], 'f2': ([1, 2, 3])[i]})""",
|
||||
"""SELECT LIST_APPLY(RANGE(1, 4), i -> {'f1': [1, 2, 3][i], 'f2': [1, 2, 3][i]})""",
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue