diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-13 09:17:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-13 09:17:40 +0000 |
commit | bdf5cc7bdd5ec93dc928d81e286f7b1e678ba19d (patch) | |
tree | 4d46f9407b792f6fd5d767d510e6865ec9640569 /tests/fixtures/optimizer/merge_subqueries.sql | |
parent | Releasing progress-linux version 18.3.0-1. (diff) | |
download | sqlglot-bdf5cc7bdd5ec93dc928d81e286f7b1e678ba19d.tar.xz sqlglot-bdf5cc7bdd5ec93dc928d81e286f7b1e678ba19d.zip |
Merging upstream version 18.4.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/fixtures/optimizer/merge_subqueries.sql | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/fixtures/optimizer/merge_subqueries.sql b/tests/fixtures/optimizer/merge_subqueries.sql index b89e2fb..eec8a73 100644 --- a/tests/fixtures/optimizer/merge_subqueries.sql +++ b/tests/fixtures/optimizer/merge_subqueries.sql @@ -310,6 +310,21 @@ FROM t1; SELECT x.a AS a, x.b AS b, ROW_NUMBER() OVER (PARTITION BY x.a ORDER BY x.a) AS row_num FROM x AS x; +# title: Don't merge window functions, inner table is aliased in outer query +with t1 as ( + SELECT + ROW_NUMBER() OVER (PARTITION BY x.a ORDER BY x.a) as row_num + FROM + x +) +SELECT + t2.row_num +FROM + t1 AS t2 +WHERE + t2.row_num = 2; +WITH t1 AS (SELECT ROW_NUMBER() OVER (PARTITION BY x.a ORDER BY x.a) AS row_num FROM x AS x) SELECT t2.row_num AS row_num FROM t1 AS t2 WHERE t2.row_num = 2; + # title: Values Test # dialect: spark WITH t1 AS ( |