ARROW-10547: [Rust][DataFusion] Do not lose Filters with UserDefined plan nodes#8633
Closed
alamb wants to merge 2 commits intoapache:masterfrom
Closed
ARROW-10547: [Rust][DataFusion] Do not lose Filters with UserDefined plan nodes#8633alamb wants to merge 2 commits intoapache:masterfrom
alamb wants to merge 2 commits intoapache:masterfrom
Conversation
alamb
commented
Nov 10, 2020
| } | ||
|
|
||
| // AND filter expressions that would be placed on the same depth | ||
| if let Some(existing_expression) = new_filtersnew_filters.get(&new_depth) { |
Contributor
Author
There was a problem hiding this comment.
I am not sure what was going on with this variable name, but I figured I would reduce the replication ;)
| }, | ||
| 1 => analyze_plan(inputs[0], depth + 1)?, | ||
| _ => { | ||
| return Err(DataFusionError::NotImplemented( |
Contributor
Author
There was a problem hiding this comment.
More generally, I am not sure how / if this filter pushdown logic will work if there are multiple child inputs as no existing LogicalPlan variant his multiple inputs at this time. We will have to handle this when / if we want to support joins as well . For now I returned a "Not Yet Implemented" type error
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I have a LogicalPlan like this (where "Extension" is some extension node type):
When I run this plan through {{ExecutionContext::optimize}} the plan that results is as follows (note the filter has been lost):
I have debugged the problem and the root cause of the issue is that the
FilterPushDownlogic is not recursing into the inputs of user defined nodes.This PR has a fix for the problem