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:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-03-07 18:09:31 +0000
commitebec59cc5cb6c6856705bf82ced7fe8d9f75b0d0 (patch)
treeeacad0719c5f2d113f221000ec126226f0d7fc9e /tests/dialects/test_dialect.py
parentReleasing debian version 11.2.3-1. (diff)
downloadsqlglot-ebec59cc5cb6c6856705bf82ced7fe8d9f75b0d0.tar.xz
sqlglot-ebec59cc5cb6c6856705bf82ced7fe8d9f75b0d0.zip
Merging upstream version 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",