summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_dialect.py
diff options
context:
space:
mode:
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",