Remove redundant unalias_nested calls for creating Filter's#11340
Merged
jonahgao merged 4 commits intoapache:mainfrom Jul 10, 2024
Merged
Remove redundant unalias_nested calls for creating Filter's#11340jonahgao merged 4 commits intoapache:mainfrom
unalias_nested calls for creating Filter's#11340jonahgao merged 4 commits intoapache:mainfrom
Conversation
alamb
commented
Jul 8, 2024
| Ok(LogicalPlan::Values(Values { schema, values })) | ||
| } | ||
| LogicalPlan::Filter(Filter { predicate, input }) => { | ||
| // todo: should this logic be moved to Filter::try_new? |
Contributor
Author
There was a problem hiding this comment.
this PR completes this TODO, per @jonahgao 's suggestion
| // Push down non-unnest filter predicate | ||
| // Unnest | ||
| // Unenst Input (Projection) | ||
| // Unnest Input (Projection) |
jonahgao
approved these changes
Jul 9, 2024
| .update_data(|new_predicate| (new_predicate, new_input)); | ||
| Ok(new_predicate) | ||
| let new_predicate = new_expr.pop().unwrap(); | ||
| // the closure didn't transform the expr, but will be |
Member
There was a problem hiding this comment.
Is it possible to remove transform_data?
self.try_unary_plan(expr, input, config)?
.map_data(|(mut new_expr, new_input)| {
assert_eq!(new_expr.len(), 1); // passed in vec![predicate]
let new_predicate = new_expr.pop().unwrap();
Filter::try_new(new_predicate, Arc::new(new_input))
.map(LogicalPlan::Filter)
})
Contributor
Author
There was a problem hiding this comment.
That is an excellent idea. It was -- done in 49d206e
Contributor
Author
|
Thanks again @jonahgao |
findepi
pushed a commit
to findepi/datafusion
that referenced
this pull request
Jul 16, 2024
…#11340) * Remove uncessary unalias_nested calls when creating Filter * simplify
xinlifoobar
pushed a commit
to xinlifoobar/datafusion
that referenced
this pull request
Jul 18, 2024
…#11340) * Remove uncessary unalias_nested calls when creating Filter * simplify
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.
Which issue does this PR close?
Closes #11339
Rationale for this change
In #11307 we changed Filter to remove any aliases within the expressions.
Thus it is no longer necessary to unalias the expressions prior to calling
Filter::try_newWhat changes are included in this PR?
unalias_nestedcalls when callingFilter::try_new()Are these changes tested?
By existing CI
Are there any user-facing changes?
No