Skip to content

Commit

Permalink
test(sql): regenerate SQL snapshot for the inner join convenience fea…
Browse files Browse the repository at this point in the history
…ture
  • Loading branch information
kszucs committed Jan 29, 2024
1 parent bdfc415 commit e0c042e
Show file tree
Hide file tree
Showing 22 changed files with 439 additions and 501 deletions.
1 change: 0 additions & 1 deletion ibis/backends/polars/tests/test_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def test_memtable_join(con):
"x": [1, 2, 3],
"y": [4, 5, 6],
"z": ["a", "b", "c"],
"x_right": [1, 2, 3],
"y_right": [9, 8, 7],
"z_right": ["f", "e", "d"],
}
Expand Down
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
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.`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) - 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
Original file line number Diff line number Diff line change
@@ -1,55 +1,42 @@
SELECT
t5.street AS street,
t5.key AS key,
t5.key_right AS key_right
FROM (
SELECT
t1.street AS street,
ROW_NUMBER() OVER (ORDER BY t1.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key,
t3.key AS key_right
FROM (
SELECT
t0.street AS 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
INNER JOIN (
SELECT
t1.key AS key
FROM (
SELECT
t0.street AS 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 t3
ON t1.key = t3.key
) AS t5
INNER JOIN (
WITH t6 AS (
SELECT
t5.key AS key
t5.street,
ROW_NUMBER() OVER (ORDER BY t5.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key
FROM (
SELECT
t1.street AS street,
ROW_NUMBER() OVER (ORDER BY t1.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS key,
t3.key AS key_right
t2.street,
t2.key
FROM (
SELECT
t0.street AS street,
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 t2
INNER JOIN (
SELECT
t1.key AS key
t1.key
FROM (
SELECT
t0.street AS street,
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 t3
ON t1.key = t3.key
) AS t4
ON t2.key = t4.key
) AS t5
) AS t7
ON t5.key = t7.key
), 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
Original file line number Diff line number Diff line change
@@ -1,55 +1,42 @@
SELECT
"t5"."street" AS "street",
"t5"."key" AS "key",
"t5"."key_right" AS "key_right"
FROM (
SELECT
"t1"."street" AS "street",
ROW_NUMBER() OVER (ORDER BY "t1"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key",
"t2"."key" AS "key_right"
FROM (
SELECT
"t0"."street" AS "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"
INNER JOIN (
SELECT
"t1"."key" AS "key"
FROM (
SELECT
"t0"."street" AS "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 "t2"
ON "t1"."key" = "t2"."key"
) AS "t5"
INNER JOIN (
WITH "t6" AS (
SELECT
"t5"."key" AS "key"
"t5"."street",
ROW_NUMBER() OVER (ORDER BY "t5"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key"
FROM (
SELECT
"t1"."street" AS "street",
ROW_NUMBER() OVER (ORDER BY "t1"."street" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "key",
"t2"."key" AS "key_right"
"t2"."street",
"t2"."key"
FROM (
SELECT
"t0"."street" AS "street",
"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 "t2"
INNER JOIN (
SELECT
"t1"."key" AS "key"
"t1"."key"
FROM (
SELECT
"t0"."street" AS "street",
"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 "t2"
ON "t1"."key" = "t2"."key"
) AS "t4"
ON "t2"."key" = "t4"."key"
) AS "t5"
) AS "t6"
ON "t5"."key" = "t6"."key"
), "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"
Original file line number Diff line number Diff line change
@@ -1,55 +1,42 @@
SELECT
t5.street AS street,
t5.key AS key,
t5.key_right AS key_right
FROM (
SELECT
t1.street AS street,
ROW_NUMBER() OVER (ORDER BY t1.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key,
t3.key AS key_right
FROM (
SELECT
t0.street AS street,
ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key
FROM data AS t0
) AS t1
INNER JOIN (
SELECT
t1.key AS key
FROM (
SELECT
t0.street AS street,
ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key
FROM data AS t0
) AS t1
) AS t3
ON t1.key = t3.key
) AS t5
INNER JOIN (
WITH t6 AS (
SELECT
t5.key AS key
t5.street,
ROW_NUMBER() OVER (ORDER BY t5.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key
FROM (
SELECT
t1.street AS street,
ROW_NUMBER() OVER (ORDER BY t1.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key,
t3.key AS key_right
t2.street,
t2.key
FROM (
SELECT
t0.street AS street,
t0.street,
ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key
FROM data AS t0
) AS t1
) AS t2
INNER JOIN (
SELECT
t1.key AS key
t1.key
FROM (
SELECT
t0.street AS street,
t0.street,
ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) AS key
FROM data AS t0
) AS t1
) AS t3
ON t1.key = t3.key
) AS t4
ON t2.key = t4.key
) AS t5
) AS t7
ON t5.key = t7.key
), t1 AS (
SELECT
t0.street,
ROW_NUMBER() OVER (ORDER BY t0.street ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - CAST(1 AS TINYINT) 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
Loading

0 comments on commit e0c042e

Please sign in to comment.