-
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
Add alias check for equijoin in from_plan #4755
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -586,6 +586,12 @@ pub fn from_plan( | |
// The preceding part of expr is equi-exprs, | ||
// and the struct of each equi-expr is like `left-expr = right-expr`. | ||
let new_on:Vec<(Expr,Expr)> = expr.iter().take(equi_expr_count).map(|equi_expr| { | ||
// SimplifyExpression rule may add alias to the equi_expr. | ||
let equi_expr = match equi_expr { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps calling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can not call the above I found another |
||
Expr::Alias(expr, _) => expr.as_ref(), | ||
_ => equi_expr, | ||
}; | ||
|
||
if let Expr::BinaryExpr(BinaryExpr { left, op, right }) = equi_expr { | ||
assert!(op == &Operator::Eq); | ||
Ok(((**left).clone(), (**right).clone())) | ||
|
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.
The
SimplifyExpressions
rule failed in this test case before, take effect now.Other test cases modified in this pr also take effect.