-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rewrite): avoid accumulating context state during rewriting (#9814)
- Loading branch information
Showing
19 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/bigquery/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,4 @@ | ||
SELECT | ||
ntile(2) OVER (ORDER BY RAND() ASC) - 1 AS `new_col` | ||
FROM `test` AS `t0` | ||
LIMIT 10 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/clickhouse/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,4 @@ | ||
SELECT | ||
ntile(2) OVER (ORDER BY randCanonical() ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "new_col" | ||
FROM "test" AS "t0" | ||
LIMIT 10 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/datafusion/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,4 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY RANDOM() ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "new_col" | ||
FROM "test" AS "t0" | ||
LIMIT 10 |
13 changes: 13 additions & 0 deletions
13
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/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,13 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY RANDOM() ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "new_col" | ||
FROM ( | ||
SELECT | ||
"test" | ||
FROM (VALUES | ||
(1), | ||
(2), | ||
(3), | ||
(4), | ||
(5)) AS "test"("test") | ||
) AS "t0" | ||
LIMIT 10 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/duckdb/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,4 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY RANDOM() ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "new_col" | ||
FROM "test" AS "t0" | ||
LIMIT 10 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/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,4 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY RANDOM() ASC) - 1 AS "new_col" | ||
FROM "test" AS "t0" | ||
LIMIT 10 |
13 changes: 13 additions & 0 deletions
13
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/flink/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,13 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY RAND() ASC NULLS LAST) - 1 AS `new_col` | ||
FROM ( | ||
SELECT | ||
`test` | ||
FROM (VALUES | ||
(1), | ||
(2), | ||
(3), | ||
(4), | ||
(5)) AS `test`(`test`) | ||
) AS `t0` | ||
LIMIT 10 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY RAND(UTC_TO_UNIX_MICROS(UTC_TIMESTAMP())) ASC) - 1 AS `new_col` | ||
FROM `test` AS `t0` | ||
LIMIT 10 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SELECT | ||
TOP 10 | ||
NTILE(2) OVER (ORDER BY RAND() ASC) - 1 AS [new_col] | ||
FROM [test] AS [t0] |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/mysql/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,4 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY RAND() ASC) - 1 AS `new_col` | ||
FROM `test` AS `t0` | ||
LIMIT 10 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY DBMS_RANDOM.VALUE() ASC) - 1 AS "new_col" | ||
FROM "test" "t0" | ||
FETCH FIRST 10 ROWS ONLY |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/postgres/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,4 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY RANDOM() ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "new_col" | ||
FROM "test" AS "t0" | ||
LIMIT 10 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/pyspark/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,4 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY RAND() ASC NULLS LAST) - 1 AS `new_col` | ||
FROM `test` AS `t0` | ||
LIMIT 10 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/risingwave/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,4 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY RANDOM() ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "new_col" | ||
FROM "test" AS "t0" | ||
LIMIT 10 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/snowflake/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,4 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY UNIFORM(TO_DOUBLE(0.0), TO_DOUBLE(1.0), RANDOM()) ASC) - 1 AS "new_col" | ||
FROM "test" AS "t0" | ||
LIMIT 10 |
6 changes: 6 additions & 0 deletions
6
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/sqlite/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,6 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY 0.5 + ( | ||
CAST(RANDOM() AS REAL) / -1.8446744073709552e+19 | ||
) ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "new_col" | ||
FROM "test" AS "t0" | ||
LIMIT 10 |
4 changes: 4 additions & 0 deletions
4
ibis/backends/tests/snapshots/test_sql/test_rewrite_context/trino/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,4 @@ | ||
SELECT | ||
NTILE(2) OVER (ORDER BY RAND() ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS "new_col" | ||
FROM "test" AS "t0" | ||
LIMIT 10 |
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
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