-
Notifications
You must be signed in to change notification settings - Fork 609
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sql): fuse
distinct
with other select nodes when possible
- Loading branch information
Showing
13 changed files
with
127 additions
and
33 deletions.
There are no files selected for viewing
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
8 changes: 2 additions & 6 deletions
8
ibis/backends/tests/sql/snapshots/test_compiler/test_column_distinct/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,7 +1,3 @@ | ||
SELECT DISTINCT | ||
* | ||
FROM ( | ||
SELECT | ||
"t0"."string_col" | ||
FROM "functional_alltypes" AS "t0" | ||
) AS "t1" | ||
"t0"."string_col" | ||
FROM "functional_alltypes" AS "t0" |
10 changes: 3 additions & 7 deletions
10
ibis/backends/tests/sql/snapshots/test_compiler/test_table_distinct/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,8 +1,4 @@ | ||
SELECT DISTINCT | ||
* | ||
FROM ( | ||
SELECT | ||
"t0"."string_col", | ||
"t0"."int_col" | ||
FROM "functional_alltypes" AS "t0" | ||
) AS "t1" | ||
"t0"."string_col", | ||
"t0"."int_col" | ||
FROM "functional_alltypes" AS "t0" |
12 changes: 12 additions & 0 deletions
12
...snapshots/test_select_sql/test_fuse_distinct/distinct-non-trivial-select-distinct/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,12 @@ | ||
SELECT DISTINCT | ||
"t1"."a", | ||
"t1"."b" % 2 AS "d" | ||
FROM ( | ||
SELECT DISTINCT | ||
"t0"."a", | ||
"t0"."b", | ||
"t0"."c" | ||
FROM "test" AS "t0" | ||
WHERE | ||
"t0"."c" > 10 | ||
) AS "t1" |
12 changes: 12 additions & 0 deletions
12
...ests/sql/snapshots/test_select_sql/test_fuse_distinct/distinct-non-trivial-select/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,12 @@ | ||
SELECT | ||
"t1"."a", | ||
"t1"."b" % 2 AS "d" | ||
FROM ( | ||
SELECT DISTINCT | ||
"t0"."a", | ||
"t0"."b", | ||
"t0"."c" | ||
FROM "test" AS "t0" | ||
WHERE | ||
"t0"."c" > 10 | ||
) AS "t1" |
6 changes: 6 additions & 0 deletions
6
...s/tests/sql/snapshots/test_select_sql/test_fuse_distinct/distinct-select-distinct/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 DISTINCT | ||
"t0"."a", | ||
"t0"."b" | ||
FROM "test" AS "t0" | ||
WHERE | ||
"t0"."c" > 10 |
6 changes: 6 additions & 0 deletions
6
ibis/backends/tests/sql/snapshots/test_select_sql/test_fuse_distinct/distinct-select/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 DISTINCT | ||
"t0"."a", | ||
"t0"."b" | ||
FROM "test" AS "t0" | ||
WHERE | ||
"t0"."c" > 10 |
6 changes: 6 additions & 0 deletions
6
...ests/sql/snapshots/test_select_sql/test_fuse_distinct/non-trivial-select-distinct/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 DISTINCT | ||
"t0"."a", | ||
"t0"."b" % 2 AS "d" | ||
FROM "test" AS "t0" | ||
WHERE | ||
"t0"."c" > 10 |
6 changes: 6 additions & 0 deletions
6
ibis/backends/tests/sql/snapshots/test_select_sql/test_fuse_distinct/select-distinct/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 DISTINCT | ||
"t0"."a", | ||
"t0"."b" | ||
FROM "test" AS "t0" | ||
WHERE | ||
"t0"."c" > 10 |
10 changes: 3 additions & 7 deletions
10
ibis/backends/tests/sql/snapshots/test_sql/test_distinct/projection_distinct/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,8 +1,4 @@ | ||
SELECT DISTINCT | ||
* | ||
FROM ( | ||
SELECT | ||
"t0"."string_col", | ||
"t0"."int_col" | ||
FROM "functional_alltypes" AS "t0" | ||
) AS "t1" | ||
"t0"."string_col", | ||
"t0"."int_col" | ||
FROM "functional_alltypes" AS "t0" |
8 changes: 2 additions & 6 deletions
8
...ends/tests/sql/snapshots/test_sql/test_distinct/single_column_projection_distinct/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,7 +1,3 @@ | ||
SELECT DISTINCT | ||
* | ||
FROM ( | ||
SELECT | ||
"t0"."string_col" | ||
FROM "functional_alltypes" AS "t0" | ||
) AS "t1" | ||
"t0"."string_col" | ||
FROM "functional_alltypes" AS "t0" |
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