jonahgao commented on code in PR #11307:
URL: https://github.com/apache/datafusion/pull/11307#discussion_r1668653670
##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -2130,16 +2130,10 @@ impl Filter {
}
}
- // filter predicates should not be aliased
- if let Expr::Alias(Alias { expr, name, .. }) = predicate {
- return plan_err!(
- "Attempted to create Filter predicate with \
- expression `{expr}` aliased as '{name}'. Filter predicates
should not be \
- aliased."
- );
- }
-
- Ok(Self { predicate, input })
+ Ok(Self {
+ predicate: predicate.unalias(),
Review Comment:
After unalias, it might still be another alias, which doesn't seem very
thorough.
Therefore, what do you think about executing `unalias_nested` during
planning, like
[this](https://github.com/jonahgao/datafusion/commit/7c924284553920004059717c1bac68d913cd6daf)?
This should be able to solve the current problem.
As for whether we need to strictly strip aliases, perhaps we can discuss
that separately.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]