-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(sql): regen snapshots for inner join key deduplication
- Loading branch information
Showing
10 changed files
with
287 additions
and
141 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
ibis/backends/tests/snapshots/test_generic/test_many_subqueries/druid/out.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
WITH "t6" AS ( | ||
SELECT | ||
"t5"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t5"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
FROM ( | ||
SELECT | ||
"t2"."street", | ||
"t2"."key" | ||
FROM ( | ||
SELECT | ||
"t0"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
FROM "data" AS "t0" | ||
) AS "t2" | ||
INNER JOIN ( | ||
SELECT | ||
"t1"."key" | ||
FROM ( | ||
SELECT | ||
"t0"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
FROM "data" AS "t0" | ||
) AS "t1" | ||
) AS "t4" | ||
ON "t2"."key" = "t4"."key" | ||
) AS "t5" | ||
), "t1" AS ( | ||
SELECT | ||
"t0"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key" | ||
FROM "data" AS "t0" | ||
) | ||
SELECT | ||
"t8"."street", | ||
"t8"."key" | ||
FROM "t6" AS "t8" | ||
INNER JOIN ( | ||
SELECT | ||
"t7"."key" | ||
FROM "t6" AS "t7" | ||
) AS "t10" | ||
ON "t8"."key" = "t10"."key" |
42 changes: 42 additions & 0 deletions
42
ibis/backends/tests/snapshots/test_generic/test_many_subqueries/exasol/out.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
WITH "t6" AS ( | ||
SELECT | ||
"t5"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t5"."street" ASC) - 1 AS "key" | ||
FROM ( | ||
SELECT | ||
"t2"."street", | ||
"t2"."key" | ||
FROM ( | ||
SELECT | ||
"t0"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC) - 1 AS "key" | ||
FROM "data" AS "t0" | ||
) AS "t2" | ||
INNER JOIN ( | ||
SELECT | ||
"t1"."key" | ||
FROM ( | ||
SELECT | ||
"t0"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC) - 1 AS "key" | ||
FROM "data" AS "t0" | ||
) AS "t1" | ||
) AS "t4" | ||
ON "t2"."key" = "t4"."key" | ||
) AS "t5" | ||
), "t1" AS ( | ||
SELECT | ||
"t0"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC) - 1 AS "key" | ||
FROM "data" AS "t0" | ||
) | ||
SELECT | ||
"t8"."street", | ||
"t8"."key" | ||
FROM "t6" AS "t8" | ||
INNER JOIN ( | ||
SELECT | ||
"t7"."key" | ||
FROM "t6" AS "t7" | ||
) AS "t10" | ||
ON "t8"."key" = "t10"."key" |
70 changes: 38 additions & 32 deletions
70
ibis/backends/tests/snapshots/test_generic/test_many_subqueries/impala/out.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,42 @@ | ||
WITH t0 AS ( | ||
WITH `t6` AS ( | ||
SELECT | ||
t5.*, | ||
( | ||
ROW_NUMBER() OVER (ORDER BY t5.`street` ASC) - 1 | ||
) AS `key` | ||
FROM `data` AS t5 | ||
), t1 AS ( | ||
`t5`.`street`, | ||
ROW_NUMBER() OVER (ORDER BY `t5`.`street` ASC NULLS LAST) - 1 AS `key` | ||
FROM ( | ||
SELECT | ||
`t2`.`street`, | ||
`t2`.`key` | ||
FROM ( | ||
SELECT | ||
`t0`.`street`, | ||
ROW_NUMBER() OVER (ORDER BY `t0`.`street` ASC NULLS LAST) - 1 AS `key` | ||
FROM `data` AS `t0` | ||
) AS `t2` | ||
INNER JOIN ( | ||
SELECT | ||
`t1`.`key` | ||
FROM ( | ||
SELECT | ||
`t0`.`street`, | ||
ROW_NUMBER() OVER (ORDER BY `t0`.`street` ASC NULLS LAST) - 1 AS `key` | ||
FROM `data` AS `t0` | ||
) AS `t1` | ||
) AS `t4` | ||
ON `t2`.`key` = `t4`.`key` | ||
) AS `t5` | ||
), `t1` AS ( | ||
SELECT | ||
t0.`key` | ||
FROM t0 | ||
), t2 AS ( | ||
SELECT | ||
t0.`street`, | ||
t0.`key` | ||
FROM t0 | ||
INNER JOIN t1 | ||
ON t0.`key` = t1.`key` | ||
), t3 AS ( | ||
SELECT | ||
t2.`street`, | ||
( | ||
ROW_NUMBER() OVER (ORDER BY t2.`street` ASC) - 1 | ||
) AS `key` | ||
FROM t2 | ||
), t4 AS ( | ||
SELECT | ||
t3.`key` | ||
FROM t3 | ||
`t0`.`street`, | ||
ROW_NUMBER() OVER (ORDER BY `t0`.`street` ASC NULLS LAST) - 1 AS `key` | ||
FROM `data` AS `t0` | ||
) | ||
SELECT | ||
t3.`street`, | ||
t3.`key` | ||
FROM t3 | ||
INNER JOIN t4 | ||
ON t3.`key` = t4.`key` | ||
`t8`.`street`, | ||
`t8`.`key` | ||
FROM `t6` AS `t8` | ||
INNER JOIN ( | ||
SELECT | ||
`t7`.`key` | ||
FROM `t6` AS `t7` | ||
) AS `t10` | ||
ON `t8`.`key` = `t10`.`key` |
66 changes: 38 additions & 28 deletions
66
ibis/backends/tests/snapshots/test_generic/test_many_subqueries/mssql/out.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,42 @@ | ||
WITH t0 AS ( | ||
WITH [t6] AS ( | ||
SELECT | ||
t5.street AS street, | ||
ROW_NUMBER() OVER (ORDER BY t5.street ASC) - 1 AS [key] | ||
FROM data AS t5 | ||
), t1 AS ( | ||
[t5].[street] AS [street], | ||
ROW_NUMBER() OVER (ORDER BY CASE WHEN [t5].[street] IS NULL THEN 1 ELSE 0 END, [t5].[street] ASC) - 1 AS [key] | ||
FROM ( | ||
SELECT | ||
[t2].[street] AS [street], | ||
[t2].[key] AS [key] | ||
FROM ( | ||
SELECT | ||
[t0].[street] AS [street], | ||
ROW_NUMBER() OVER (ORDER BY CASE WHEN [t0].[street] IS NULL THEN 1 ELSE 0 END, [t0].[street] ASC) - 1 AS [key] | ||
FROM [data] AS [t0] | ||
) AS [t2] | ||
INNER JOIN ( | ||
SELECT | ||
[t1].[key] AS [key] | ||
FROM ( | ||
SELECT | ||
[t0].[street] AS [street], | ||
ROW_NUMBER() OVER (ORDER BY CASE WHEN [t0].[street] IS NULL THEN 1 ELSE 0 END, [t0].[street] ASC) - 1 AS [key] | ||
FROM [data] AS [t0] | ||
) AS [t1] | ||
) AS [t4] | ||
ON [t2].[key] = [t4].[key] | ||
) AS [t5] | ||
), [t1] AS ( | ||
SELECT | ||
t0.[key] AS [key] | ||
FROM t0 | ||
), t2 AS ( | ||
SELECT | ||
t0.street AS street, | ||
t0.[key] AS [key] | ||
FROM t0 | ||
JOIN t1 | ||
ON t0.[key] = t1.[key] | ||
), t3 AS ( | ||
SELECT | ||
t2.street AS street, | ||
ROW_NUMBER() OVER (ORDER BY t2.street ASC) - 1 AS [key] | ||
FROM t2 | ||
), t4 AS ( | ||
SELECT | ||
t3.[key] AS [key] | ||
FROM t3 | ||
[t0].[street] AS [street], | ||
ROW_NUMBER() OVER (ORDER BY CASE WHEN [t0].[street] IS NULL THEN 1 ELSE 0 END, [t0].[street] ASC) - 1 AS [key] | ||
FROM [data] AS [t0] | ||
) | ||
SELECT | ||
t3.street, | ||
t3.[key] | ||
FROM t3 | ||
JOIN t4 | ||
ON t3.[key] = t4.[key] | ||
[t8].[street], | ||
[t8].[key] | ||
FROM [t6] AS [t8] | ||
INNER JOIN ( | ||
SELECT | ||
[t7].[key] AS [key] | ||
FROM [t6] AS [t7] | ||
) AS [t10] | ||
ON [t8].[key] = [t10].[key] |
66 changes: 38 additions & 28 deletions
66
ibis/backends/tests/snapshots/test_generic/test_many_subqueries/oracle/out.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,42 @@ | ||
WITH t0 AS ( | ||
WITH "t6" AS ( | ||
SELECT | ||
t5."street" AS "street", | ||
ROW_NUMBER() OVER (ORDER BY t5."street" ASC) - 1 AS "key" | ||
FROM "data" t5 | ||
), t1 AS ( | ||
"t5"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t5"."street" ASC NULLS LAST) - 1 AS "key" | ||
FROM ( | ||
SELECT | ||
"t2"."street", | ||
"t2"."key" | ||
FROM ( | ||
SELECT | ||
"t0"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC NULLS LAST) - 1 AS "key" | ||
FROM "data" "t0" | ||
) "t2" | ||
INNER JOIN ( | ||
SELECT | ||
"t1"."key" | ||
FROM ( | ||
SELECT | ||
"t0"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC NULLS LAST) - 1 AS "key" | ||
FROM "data" "t0" | ||
) "t1" | ||
) "t4" | ||
ON "t2"."key" = "t4"."key" | ||
) "t5" | ||
), "t1" AS ( | ||
SELECT | ||
t0."key" AS "key" | ||
FROM t0 | ||
), t2 AS ( | ||
SELECT | ||
t0."street" AS "street", | ||
t0."key" AS "key" | ||
FROM t0 | ||
JOIN t1 | ||
ON t0."key" = t1."key" | ||
), t3 AS ( | ||
SELECT | ||
t2."street" AS "street", | ||
ROW_NUMBER() OVER (ORDER BY t2."street" ASC) - 1 AS "key" | ||
FROM t2 | ||
), t4 AS ( | ||
SELECT | ||
t3."key" AS "key" | ||
FROM t3 | ||
"t0"."street", | ||
ROW_NUMBER() OVER (ORDER BY "t0"."street" ASC NULLS LAST) - 1 AS "key" | ||
FROM "data" "t0" | ||
) | ||
SELECT | ||
t3."street", | ||
t3."key" | ||
FROM t3 | ||
JOIN t4 | ||
ON t3."key" = t4."key" | ||
"t8"."street", | ||
"t8"."key" | ||
FROM "t6" "t8" | ||
INNER JOIN ( | ||
SELECT | ||
"t7"."key" | ||
FROM "t6" "t7" | ||
) "t10" | ||
ON "t8"."key" = "t10"."key" |
20 changes: 20 additions & 0 deletions
20
ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/druid/out.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
WITH "t1" AS ( | ||
SELECT | ||
"t0"."key" | ||
FROM "leaf" AS "t0" | ||
WHERE | ||
TRUE | ||
) | ||
SELECT | ||
"t3"."key" | ||
FROM "t1" AS "t3" | ||
INNER JOIN "t1" AS "t4" | ||
ON "t3"."key" = "t4"."key" | ||
INNER JOIN ( | ||
SELECT | ||
"t3"."key" | ||
FROM "t1" AS "t3" | ||
INNER JOIN "t1" AS "t4" | ||
ON "t3"."key" = "t4"."key" | ||
) AS "t6" | ||
ON "t3"."key" = "t6"."key" |
20 changes: 20 additions & 0 deletions
20
ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/exasol/out.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
WITH "t1" AS ( | ||
SELECT | ||
"t0"."key" | ||
FROM "leaf" AS "t0" | ||
WHERE | ||
TRUE | ||
) | ||
SELECT | ||
"t3"."key" | ||
FROM "t1" AS "t3" | ||
INNER JOIN "t1" AS "t4" | ||
ON "t3"."key" = "t4"."key" | ||
INNER JOIN ( | ||
SELECT | ||
"t3"."key" | ||
FROM "t1" AS "t3" | ||
INNER JOIN "t1" AS "t4" | ||
ON "t3"."key" = "t4"."key" | ||
) AS "t6" | ||
ON "t3"."key" = "t6"."key" |
32 changes: 15 additions & 17 deletions
32
ibis/backends/tests/snapshots/test_sql/test_cte_refs_in_topo_order/impala/out.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
WITH t0 AS ( | ||
WITH `t1` AS ( | ||
SELECT | ||
t4.* | ||
FROM `leaf` AS t4 | ||
`t0`.`key` | ||
FROM `leaf` AS `t0` | ||
WHERE | ||
TRUE | ||
), t1 AS ( | ||
SELECT | ||
t0.`key` | ||
FROM t0 | ||
), t2 AS ( | ||
SELECT | ||
t0.`key` | ||
FROM t0 | ||
INNER JOIN t1 | ||
ON t0.`key` = t1.`key` | ||
) | ||
SELECT | ||
t2.`key` | ||
FROM t2 | ||
INNER JOIN t2 AS t3 | ||
ON t2.`key` = t3.`key` | ||
`t3`.`key` | ||
FROM `t1` AS `t3` | ||
INNER JOIN `t1` AS `t4` | ||
ON `t3`.`key` = `t4`.`key` | ||
INNER JOIN ( | ||
SELECT | ||
`t3`.`key` | ||
FROM `t1` AS `t3` | ||
INNER JOIN `t1` AS `t4` | ||
ON `t3`.`key` = `t4`.`key` | ||
) AS `t6` | ||
ON `t3`.`key` = `t6`.`key` |
Oops, something went wrong.