diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-07 18:09:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-07 18:09:27 +0000 |
commit | e4c72fd7c8018d9dfc6043e7304275e2fffac89f (patch) | |
tree | fb9c5556844d46d0e59cc31f129d03502f06f571 /tests/dialects/test_dialect.py | |
parent | Adding upstream version 11.2.3. (diff) | |
download | sqlglot-upstream/11.3.0.tar.xz sqlglot-upstream/11.3.0.zip |
Adding upstream version 11.3.0.upstream/11.3.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/dialects/test_dialect.py | 12 |
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", |