Merging upstream version 25.16.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
7688e2bdf8
commit
bad79d1f7c
110 changed files with 75353 additions and 68092 deletions
|
@ -6,7 +6,6 @@ class TestRedshift(Validator):
|
|||
dialect = "redshift"
|
||||
|
||||
def test_redshift(self):
|
||||
self.validate_identity("1 div", "1 AS div")
|
||||
self.validate_all(
|
||||
"SELECT SPLIT_TO_ARRAY('12,345,6789')",
|
||||
write={
|
||||
|
@ -315,6 +314,7 @@ class TestRedshift(Validator):
|
|||
)
|
||||
|
||||
def test_identity(self):
|
||||
self.validate_identity("1 div", "1 AS div")
|
||||
self.validate_identity("LISTAGG(DISTINCT foo, ', ')")
|
||||
self.validate_identity("CREATE MATERIALIZED VIEW orders AUTO REFRESH YES AS SELECT 1")
|
||||
self.validate_identity("SELECT DATEADD(DAY, 1, 'today')")
|
||||
|
@ -337,6 +337,10 @@ class TestRedshift(Validator):
|
|||
self.validate_identity(
|
||||
"""SELECT JSON_EXTRACT_PATH_TEXT('{"f2":{"f3":1},"f4":{"f5":99,"f6":"star"}', 'f4', 'f6', TRUE)"""
|
||||
)
|
||||
self.validate_identity(
|
||||
'DATE_PART(year, "somecol")',
|
||||
'EXTRACT(year FROM "somecol")',
|
||||
).this.assert_is(exp.Var)
|
||||
self.validate_identity(
|
||||
"SELECT CONCAT('abc', 'def')",
|
||||
"SELECT 'abc' || 'def'",
|
||||
|
@ -430,6 +434,14 @@ ORDER BY
|
|||
)
|
||||
self.validate_identity("SELECT JSON_PARSE('[]')")
|
||||
|
||||
self.validate_identity("SELECT ARRAY(1, 2, 3)")
|
||||
self.validate_identity("SELECT ARRAY[1, 2, 3]")
|
||||
|
||||
self.validate_identity(
|
||||
"""SELECT CONVERT_TIMEZONE('America/New_York', '2024-08-06 09:10:00.000')""",
|
||||
"""SELECT CONVERT_TIMEZONE('UTC', 'America/New_York', '2024-08-06 09:10:00.000')""",
|
||||
)
|
||||
|
||||
def test_values(self):
|
||||
# Test crazy-sized VALUES clause to UNION ALL conversion to ensure we don't get RecursionError
|
||||
values = [str(v) for v in range(0, 10000)]
|
||||
|
@ -608,3 +620,9 @@ FROM (
|
|||
"select a.foo, b.bar, a.baz from a, b where a.baz = b.baz (+)",
|
||||
"SELECT a.foo, b.bar, a.baz FROM a, b WHERE a.baz = b.baz (+)",
|
||||
)
|
||||
|
||||
def test_time(self):
|
||||
self.validate_all(
|
||||
"TIME_TO_STR(a, '%Y-%m-%d %H:%M:%S.%f')",
|
||||
write={"redshift": "TO_CHAR(a, 'YYYY-MM-DD HH24:MI:SS.US')"},
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue