summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_dialect.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-07 18:09:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-07 18:09:27 +0000
commite4c72fd7c8018d9dfc6043e7304275e2fffac89f (patch)
treefb9c5556844d46d0e59cc31f129d03502f06f571 /tests/dialects/test_dialect.py
parentAdding upstream version 11.2.3. (diff)
downloadsqlglot-e4c72fd7c8018d9dfc6043e7304275e2fffac89f.tar.xz
sqlglot-e4c72fd7c8018d9dfc6043e7304275e2fffac89f.zip
Adding upstream version 11.3.0.upstream/11.3.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_dialect.py')
-rw-r--r--tests/dialects/test_dialect.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/dialects/test_dialect.py b/tests/dialects/test_dialect.py
index 3186390..5054d94 100644
--- a/tests/dialects/test_dialect.py
+++ b/tests/dialects/test_dialect.py
@@ -520,7 +520,7 @@ class TestDialect(Validator):
"mysql": "DATE_ADD(x, INTERVAL 1 DAY)",
"postgres": "x + INTERVAL '1' 'day'",
"presto": "DATE_ADD('day', 1, x)",
- "snowflake": "DATEADD(x, 1, 'day')",
+ "snowflake": "DATEADD(day, 1, x)",
"spark": "DATE_ADD(x, 1)",
"sqlite": "DATE(x, '1 day')",
"starrocks": "DATE_ADD(x, INTERVAL 1 DAY)",
@@ -1280,6 +1280,16 @@ class TestDialect(Validator):
},
)
self.validate_all(
+ "SELECT * FROM (SELECT * FROM my_table AS t) AS tbl",
+ write={
+ "drill": "SELECT * FROM (SELECT * FROM my_table AS t) AS tbl",
+ "hive": "SELECT * FROM (SELECT * FROM my_table AS t) AS tbl",
+ "oracle": "SELECT * FROM (SELECT * FROM my_table t) tbl",
+ "postgres": "SELECT * FROM (SELECT * FROM my_table AS t) AS tbl",
+ "sqlite": "SELECT * FROM (SELECT * FROM my_table AS t) AS tbl",
+ },
+ )
+ self.validate_all(
"WITH cte1 AS (SELECT a, b FROM table1), cte2 AS (SELECT c, e AS d FROM table2) SELECT b, d AS dd FROM cte1 AS t JOIN cte2 WHERE cte1.a = cte2.c",
write={
"hive": "WITH cte1 AS (SELECT a, b FROM table1), cte2 AS (SELECT c, e AS d FROM table2) SELECT b, d AS dd FROM cte1 AS t JOIN cte2 WHERE cte1.a = cte2.c",