diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-10-15 13:53:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-10-15 13:53:00 +0000 |
commit | 684905e3de7854a3806ffa55e0d1a09431ba5a19 (patch) | |
tree | 127ebd7d051f15fb8f8cf36cfd04a8a65a4d9680 /tests/fixtures/pretty.sql | |
parent | Releasing debian version 6.3.1-1. (diff) | |
download | sqlglot-684905e3de7854a3806ffa55e0d1a09431ba5a19.tar.xz sqlglot-684905e3de7854a3806ffa55e0d1a09431ba5a19.zip |
Merging upstream version 7.1.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/fixtures/pretty.sql')
-rw-r--r-- | tests/fixtures/pretty.sql | 103 |
1 files changed, 63 insertions, 40 deletions
diff --git a/tests/fixtures/pretty.sql b/tests/fixtures/pretty.sql index 19a7451..2570650 100644 --- a/tests/fixtures/pretty.sql +++ b/tests/fixtures/pretty.sql @@ -56,14 +56,10 @@ LEFT JOIN ( WITH cte1 AS ( SELECT a, - z - AND e AS b + z AND e AS b FROM cte WHERE - x IN (1, 2, 3) - AND z < -1 - OR z > 1 - AND w = 'AND' + x IN (1, 2, 3) AND z < -1 OR z > 1 AND w = 'AND' ), cte2 AS ( SELECT RANK() OVER (PARTITION BY a, b ORDER BY x DESC) AS a, @@ -77,18 +73,12 @@ WITH cte1 AS ( 2 UNION ALL SELECT - CASE x - AND 1 + 1 = 2 + CASE x AND 1 + 1 = 2 WHEN TRUE - THEN 1 - AND 4 + 3 - AND Z - WHEN x - AND y + THEN 1 AND 4 + 3 AND Z + WHEN x AND y THEN 2 - ELSE 3 - AND 4 - AND g + ELSE 3 AND 4 AND g END UNION ALL SELECT @@ -102,18 +92,8 @@ WITH cte1 AS ( ) AS z UNION ALL SELECT - MAX(COALESCE(x - AND y, a - AND b - AND c, d - AND e)), - FOO(CASE - WHEN a - AND b - THEN c - AND d - ELSE 3 - END) + MAX(COALESCE(x AND y, a AND b AND c, d AND e)), + FOO(CASE WHEN a AND b THEN c AND d ELSE 3 END) GROUP BY x GROUPING SETS ( @@ -154,10 +134,8 @@ LEFT JOIN ( FROM bar WHERE ( - c > 1 - AND d > 1 - ) - OR e > 1 + c > 1 AND d > 1 + ) OR e > 1 GROUP BY a HAVING @@ -165,11 +143,8 @@ LEFT JOIN ( LIMIT 10 ) AS z ) AS y - ON x.a = y.b - AND x.a > 1 - OR ( - x.c = y.d - OR x.c = y.e + ON x.a = y.b AND x.a > 1 OR ( + x.c = y.d OR x.c = y.e ); SELECT myCol1, myCol2 FROM baseTable LATERAL VIEW OUTER explode(col1) myTable1 AS myCol1 LATERAL VIEW explode(col2) myTable2 AS myCol2 @@ -184,9 +159,7 @@ EXPLODE(col1) myTable1 AS myCol1 LATERAL VIEW EXPLODE(col2) myTable2 AS myCol2 WHERE - a > 1 - AND b > 2 - OR c > 3; + a > 1 AND b > 2 OR c > 3; SELECT * FROM (WITH y AS ( SELECT 1 AS z) SELECT z from y) x; SELECT @@ -264,3 +237,53 @@ CREATE TABLE "t_customer_account" ( "account_no" VARCHAR(100) ); + +SELECT +x("aaaaaaaaaaaaaa", "bbbbbbbbbbbbb", "ccccccccc", "ddddddddddddd", "eeeeeeeeeeeee", "fffffff"), +array("aaaaaaaaaaaaaa", "bbbbbbbbbbbbb", "ccccccccc", "ddddddddddddd", "eeeeeeeeeeeee", "fffffff"), +array("aaaaaaaaaaaaaa", "bbbbbbbbbbbbb", "ccccccccc", "ddddddddddddd", "eeeeeeeeeeeee", "fffffff", array("aaaaaaaaaaaaaa", "bbbbbbbbbbbbb", "ccccccccc", "ddddddddddddd", "eeeeeeeeeeeee", "fffffff")), +array(array("aaaaaaaaaaaaaa", "bbbbbbbbbbbbb", "ccccccccc", "ddddddddddddd", "eeeeeeeeeeeee", "fffffff")), +; +SELECT + X( + "aaaaaaaaaaaaaa", + "bbbbbbbbbbbbb", + "ccccccccc", + "ddddddddddddd", + "eeeeeeeeeeeee", + "fffffff" + ), + ARRAY( + "aaaaaaaaaaaaaa", + "bbbbbbbbbbbbb", + "ccccccccc", + "ddddddddddddd", + "eeeeeeeeeeeee", + "fffffff" + ), + ARRAY( + "aaaaaaaaaaaaaa", + "bbbbbbbbbbbbb", + "ccccccccc", + "ddddddddddddd", + "eeeeeeeeeeeee", + "fffffff", + ARRAY( + "aaaaaaaaaaaaaa", + "bbbbbbbbbbbbb", + "ccccccccc", + "ddddddddddddd", + "eeeeeeeeeeeee", + "fffffff" + ) + ), + ARRAY( + ARRAY( + "aaaaaaaaaaaaaa", + "bbbbbbbbbbbbb", + "ccccccccc", + "ddddddddddddd", + "eeeeeeeeeeeee", + "fffffff" + ) + ); |