-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7725 from RinChanNOWWW/nullable_pruner
feat(query): enable range filter to pre-filter `is_null` and `is_not_null` ops.
- Loading branch information
Showing
6 changed files
with
108 additions
and
21 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
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
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
47 changes: 47 additions & 0 deletions
47
tests/logictest/suites/mode/standalone/explain/nullable_prune.test
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,47 @@ | ||
statement ok | ||
create table t_nullable_prune (a int null); | ||
|
||
statement ok | ||
insert into t_nullable_prune select * from numbers(3); | ||
|
||
statement ok | ||
insert into t_nullable_prune select null from numbers(3); | ||
|
||
statement query T | ||
explain select * from t_nullable_prune; | ||
|
||
---- | ||
TableScan | ||
├── table: default.default.t_nullable_prune | ||
├── read rows: 6 | ||
├── read bytes: 62 | ||
├── partitions total: 2 | ||
├── partitions scanned: 2 | ||
└── push downs: [filters: [], limit: NONE] | ||
|
||
statement query T | ||
explain select * from t_nullable_prune where a is not null; | ||
|
||
---- | ||
TableScan | ||
├── table: default.default.t_nullable_prune | ||
├── read rows: 3 | ||
├── read bytes: 37 | ||
├── partitions total: 2 | ||
├── partitions scanned: 1 | ||
└── push downs: [filters: [is_not_null(a)], limit: NONE] | ||
|
||
statement query T | ||
explain select * from t_nullable_prune where a is null; | ||
|
||
---- | ||
TableScan | ||
├── table: default.default.t_nullable_prune | ||
├── read rows: 3 | ||
├── read bytes: 25 | ||
├── partitions total: 2 | ||
├── partitions scanned: 1 | ||
└── push downs: [filters: [not(is_not_null(a))], limit: NONE] | ||
|
||
statement ok | ||
DROP TABLE default.default.t_nullable_prune; |
985d6f8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
databend – ./
databend-git-main-databend.vercel.app
databend.vercel.app
databend-databend.vercel.app
databend.rs