Uh oh!
There was an error while loading. Please reload this page.
fix: Add additional required expression for natural join - #11713
Conversation
alamb
left a comment
There was a problem hiding this comment.
Thanks @Lordworms -- this code looks reasonable to me. I had some suggestions / requests for some more comments.
Maybe @jonahgao has ideas of how to improve this too
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jonahgao
commented
Aug 2, 2024
I checked that the final logical plan is correct, but the calling of expand_wildcard in The use of letmut projection = vec![Expr::Wildcard];
projection.extend(expr_join_keys.into_iter());LogicalPlanBuilder::from(input).project(projection)?
.build()?Its purpose should be to re-project all the outputs of the input plan. So I think another simpler fix might be to replace |
I agree, It's is much simpler, I was thinking about how to add missing expressions that are excluded by |
alamb
left a comment
There was a problem hiding this comment.
Thank you @Lordworms and @jonahgao -- this is a beautifully simple PR now. 🏆
| let need_project = join_keys.iter().any(|key| !matches!(key, Expr::Column(_))); | ||
| let plan = if need_project { | ||
| let mut projection = expand_wildcard(input_schema, &input, None)?; | ||
| // Include all columns from the input and extend them with the join keys |
Which issue does this PR close?
Closes#11635
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?