-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The check for whether or not a filter expression could be pushed beyond an agg node was incorrect. It was checking if the column was in the group by columns (checking the equality of the numbers), when it should be checking based on indices if we are only referring to columns that are *emitted* from the agg node as group by columns. For example, if we see: ``` Filter #1 > 100 Agg { groups: [#1], agg: Sum() } ``` We should *not* push down because `#1` refers to the sum column. In the current main branch, it is pushed down because it sees that `#1` equals a column in the `groups` field. It should be checking that every column is `< groups.len()` instead.
- Loading branch information
Showing
4 changed files
with
60 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
statement ok | ||
create table t1(v1 int, v2 int); | ||
|
||
statement ok | ||
create table t2(v3 int, v4 int); | ||
|
||
statement ok | ||
insert into t1 values (1, 100), (2, 200), (2, 250), (3, 300), (3, 300); | ||
|
||
statement ok | ||
insert into t2 values (2, 200), (2, 250), (3, 300); |
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,9 @@ | ||
include _basic_tables.slt.part | ||
|
||
query | ||
select * from t1 where (select sum(v4) from t2 where v3 = v1) > 100; | ||
---- | ||
2 200 | ||
2 250 | ||
3 300 | ||
3 300 |
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