-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ExecutionPlan: add APIs for filter pushdown & optimizer rule to apply them #15566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
a653b15
ExecutionPlan: add APIs for filter pushdown & optimizer rule to apply…
adriangb a5f998c
wip
adriangb 7e2db66
fix tests
adriangb cb1f830
fix
adriangb e92d8b5
fix
adriangb ca391c1
fix doc
adriangb c78a590
fix doc
adriangb 34c8285
Improve doc comments of `filter-pushdown-apis` (#22)
alamb e15374f
Apply suggestions from code review
adriangb 2ceec35
simplify according to pr feedback
adriangb 3fbf379
Add missing file
adriangb e6721d1
Add tests
adriangb b7b588b
pipe config in
adriangb d1f01dd
docstrings
adriangb 5929d03
Update datafusion/physical-plan/src/filter_pushdown.rs
adriangb 24483bc
fix
adriangb d0295ed
fix
adriangb 2d46289
fmt
adriangb 4318267
fix doc
adriangb 7d29056
add example usage of config
adriangb d382bd3
fix test
adriangb 2dfa8b8
convert exec API and optimizer rule
berkaysynnada cda6e8d
re-add docs
adriangb e4d8a8c
dbg
berkaysynnada 3ec1b2a
dbg 2
berkaysynnada a2df5e0
avoid clones
adriangb 6938d52
part 3
berkaysynnada 6836dd4
fix lint
adriangb 28bb8ea
Merge branch 'filter-pushdown-apis' into filter-pushdown-apis
berkaysynnada 7e95283
tests pass
berkaysynnada e2f8c12
Update filter.rs
berkaysynnada bff47be
update projection tests
berkaysynnada ce49ad4
update slt files
adriangb d5792bc
Merge branch 'main' into filter-pushdown-apis
adriangb 834f33e
fix
adriangb 9e59246
fix references
adriangb 57a1230
improve impls and update tests
berkaysynnada 367377f
apply stop logic
berkaysynnada 616165d
update slt's
berkaysynnada b30953f
update other tests
berkaysynnada ec54cca
minor
berkaysynnada 6345315
rename modules to match logical optimizer, tweak docs
adriangb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
simplify according to pr feedback
- Loading branch information
commit 2ceec35c3c09213f5fddc348f41301e201c298df
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -50,7 +50,7 @@ use log::{debug, warn}; | |
|
|
||
| use crate::{ | ||
| display::FileGroupsDisplay, | ||
| file::FileSource, | ||
| file::{FileSource, FileSourceFilterPushdownResult}, | ||
| file_compression_type::FileCompressionType, | ||
| file_stream::FileStream, | ||
| source::{DataSource, DataSourceExec}, | ||
|
|
@@ -585,19 +585,25 @@ impl DataSource for FileScanConfig { | |
| })) | ||
| } | ||
|
|
||
| fn push_down_filters( | ||
| fn try_pushdown_filters( | ||
| &self, | ||
| filters: &[PhysicalExprRef], | ||
| ) -> Result<Option<DataSourceFilterPushdownResult>> { | ||
| if let Some(file_source_result) = self.file_source.push_down_filters(filters)? { | ||
| let mut new_self = self.clone(); | ||
| new_self.file_source = file_source_result.inner; | ||
| Ok(Some(DataSourceFilterPushdownResult { | ||
| inner: Arc::new(new_self) as Arc<dyn DataSource>, | ||
| support: file_source_result.support, | ||
| })) | ||
| } else { | ||
| Ok(None) | ||
| ) -> Result<DataSourceFilterPushdownResult> { | ||
| match self.file_source.try_pushdown_filters(filters)? { | ||
| FileSourceFilterPushdownResult::NotPushed => { | ||
| Ok(DataSourceFilterPushdownResult::NotPushed) | ||
| } | ||
| FileSourceFilterPushdownResult::Pushed { inner, support } => { | ||
| let new_self = Arc::new( | ||
| FileScanConfigBuilder::from(self.clone()) | ||
| .with_source(inner) | ||
| .build(), | ||
| ); | ||
| Ok(DataSourceFilterPushdownResult::Pushed { | ||
| inner: new_self, | ||
|
||
| support, | ||
| }) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
for convenience and consistency, can we rename this as parent_filters as well?