Adding upstream version 25.18.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
1341bc6477
commit
b35dbeb6b6
81 changed files with 34133 additions and 33517 deletions
|
@ -675,13 +675,6 @@ class TestPostgres(Validator):
|
|||
"presto": "RTRIM(' XXX ')",
|
||||
},
|
||||
)
|
||||
self.validate_all(
|
||||
"""'{"a":1,"b":2}'::json->'b'""",
|
||||
write={
|
||||
"postgres": """CAST('{"a":1,"b":2}' AS JSON) -> 'b'""",
|
||||
"redshift": """JSON_EXTRACT_PATH_TEXT('{"a":1,"b":2}', 'b')""",
|
||||
},
|
||||
)
|
||||
self.validate_all(
|
||||
"TRIM(BOTH 'as' FROM 'as string as')",
|
||||
write={
|
||||
|
@ -689,6 +682,21 @@ class TestPostgres(Validator):
|
|||
"spark": "TRIM(BOTH 'as' FROM 'as string as')",
|
||||
},
|
||||
)
|
||||
self.validate_identity(
|
||||
"""SELECT TRIM(LEADING ' XXX ' COLLATE "de_DE")""",
|
||||
"""SELECT LTRIM(' XXX ' COLLATE "de_DE")""",
|
||||
)
|
||||
self.validate_identity(
|
||||
"""SELECT TRIM(TRAILING ' XXX ' COLLATE "de_DE")""",
|
||||
"""SELECT RTRIM(' XXX ' COLLATE "de_DE")""",
|
||||
)
|
||||
self.validate_all(
|
||||
"""'{"a":1,"b":2}'::json->'b'""",
|
||||
write={
|
||||
"postgres": """CAST('{"a":1,"b":2}' AS JSON) -> 'b'""",
|
||||
"redshift": """JSON_EXTRACT_PATH_TEXT('{"a":1,"b":2}', 'b')""",
|
||||
},
|
||||
)
|
||||
self.validate_all(
|
||||
"""merge into x as x using (select id) as y on a = b WHEN matched then update set X."A" = y.b""",
|
||||
write={
|
||||
|
@ -780,6 +788,13 @@ class TestPostgres(Validator):
|
|||
},
|
||||
)
|
||||
|
||||
self.validate_identity(
|
||||
'SELECT js, js IS JSON AS "json?", js IS JSON VALUE AS "scalar?", js IS JSON SCALAR AS "scalar?", js IS JSON OBJECT AS "object?", js IS JSON ARRAY AS "array?" FROM t'
|
||||
)
|
||||
self.validate_identity(
|
||||
'SELECT js, js IS JSON ARRAY WITH UNIQUE KEYS AS "array w. UK?", js IS JSON ARRAY WITHOUT UNIQUE KEYS AS "array w/o UK?", js IS JSON ARRAY UNIQUE KEYS AS "array w UK 2?" FROM t'
|
||||
)
|
||||
|
||||
def test_ddl(self):
|
||||
# Checks that user-defined types are parsed into DataType instead of Identifier
|
||||
self.parse_one("CREATE TABLE t (a udt)").this.expressions[0].args["kind"].assert_is(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue