-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove redundant unalias_nested
calls for creating Filter's
#11340
Conversation
@@ -645,39 +643,6 @@ impl LogicalPlan { | |||
Ok(LogicalPlan::Values(Values { schema, values })) | |||
} | |||
LogicalPlan::Filter(Filter { predicate, input }) => { | |||
// todo: should this logic be moved to Filter::try_new? |
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.
this PR completes this TODO, per @jonahgao 's suggestion
@@ -761,11 +761,11 @@ impl OptimizerRule for PushDownFilter { | |||
|
|||
// Push down non-unnest filter predicate | |||
// Unnest | |||
// Unenst Input (Projection) | |||
// Unnest Input (Projection) |
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.
drive by typo fixup
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.
Looks good to me! Thanks @alamb
.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 |
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.
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)
})
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.
That is an excellent idea. It was -- done in 49d206e
Thanks again @jonahgao |
…#11340) * Remove uncessary unalias_nested calls when creating Filter * simplify
…#11340) * Remove uncessary unalias_nested calls when creating Filter * simplify
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_new
What changes are included in this PR?
unalias_nested
calls when callingFilter::try_new()
Are these changes tested?
By existing CI
Are there any user-facing changes?
No