diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-19 11:01:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-19 11:01:55 +0000 |
commit | f1c2dbe3b17a0d5edffbb65b85b642d0bb2756c5 (patch) | |
tree | 5dce0fe2a11381761496eb973c20750f44db56d5 /tests/fixtures/optimizer/optimizer.sql | |
parent | Releasing debian version 20.1.0-1. (diff) | |
download | sqlglot-f1c2dbe3b17a0d5edffbb65b85b642d0bb2756c5.tar.xz sqlglot-f1c2dbe3b17a0d5edffbb65b85b642d0bb2756c5.zip |
Merging upstream version 20.3.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/fixtures/optimizer/optimizer.sql | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/tests/fixtures/optimizer/optimizer.sql b/tests/fixtures/optimizer/optimizer.sql index f81d54a..4ae9e90 100644 --- a/tests/fixtures/optimizer/optimizer.sql +++ b/tests/fixtures/optimizer/optimizer.sql @@ -131,7 +131,7 @@ SELECT SUM("y"."b") AS "sum_b" FROM "x" AS "x" LEFT JOIN "_u_0" AS "_u_0" - ON "x"."b" = "_u_0"."_u_1" + ON "_u_0"."_u_1" = "x"."b" JOIN "y" AS "y" ON "x"."b" = "y"."b" WHERE @@ -522,7 +522,7 @@ OR ( SELECT *, IFF( - IFF("unioned"."uploaded_at" >= '2022-06-16', 'workday', 'bamboohr') = "unioned"."source_system", + "unioned"."source_system" = IFF("unioned"."uploaded_at" >= '2022-06-16', 'workday', 'bamboohr'), 1, 0 ) AS "sort_order" @@ -950,7 +950,7 @@ SELECT FROM "y" AS "y" CROSS JOIN "_u_0" AS "_u_0" JOIN "x" AS "x" - ON "y"."b" = "x"."b" + ON "x"."b" = "y"."b" GROUP BY "x"."a"; @@ -989,7 +989,7 @@ SELECT COALESCE("m"."a", "foo"."a") AS "a" FROM "m" JOIN "n" AS "foo"("a") - ON "m"."a" = "foo"."a"; + ON "foo"."a" = "m"."a"; # title: reduction of string concatenation that uses CONCAT(..), || and + # execute: false @@ -1068,7 +1068,7 @@ SELECT COALESCE("alias3"."c_od", 0) AS "c_od" FROM "table1" AS "table1" LEFT JOIN "alias3" - ON "table1"."cid" = "alias3"."cid"; + ON "alias3"."cid" = "table1"."cid"; # title: CTE with EXPLODE cannot be merged # dialect: spark @@ -1115,3 +1115,32 @@ WITH `t` AS ( SELECT `t`.`CoL` AS `CoL` FROM `t`; + +# title: top-level query is parenthesized +# execute: false +WITH x AS ( + SELECT a FROM t +) +( + SELECT * FROM x + UNION ALL + SELECT * FROM x + LIMIT 10 +) +LIMIT 10; +WITH "x" AS ( + SELECT + "t"."a" AS "a" + FROM "t" AS "t" +) +( + SELECT + "x"."a" AS "a" + FROM "x" + UNION ALL + SELECT + "x"."a" AS "a" + FROM "x" + LIMIT 10 +) +LIMIT 10; |