-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor, planner: fix some cases for natural_using_join #20977
Conversation
/reward 900 |
Reward success. |
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.
LGTM
field.SetText(name.ColName.O) | ||
resultList = append(resultList, field) | ||
list := unfoldWildStar(field, p.OutputNames(), p.Schema().Columns) | ||
if isJoin && join.redundantSchema != nil && field.WildCard.Table.L != "" { |
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.
Add comment for this part.
@@ -978,6 +980,19 @@ func (b *PlanBuilder) buildProjectionField(ctx context.Context, p LogicalPlan, f | |||
return newCol, name, nil | |||
} | |||
|
|||
func findColFromNaturalUsingJoin(p LogicalPlan, col *expression.Column) (name *types.FieldName) { |
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.
Add comment for the function header.
if idx < 0 { | ||
return -1, nil | ||
switch x := p.(type) { |
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.
Add comment for this switch clause
// We record the full `rightPlan.Schema` as `redundantSchema` in order to | ||
// record the redundant column in `rightPlan` and the output columns order | ||
// of the `rightPlan`. | ||
// For SQL like `select t1.*, t2.* from t1 left join t2 using(a)`, we can |
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.
three-way join will be a better example.
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.
lgtm
/merge |
/run-all-tests |
1 similar comment
/run-all-tests |
@XuHuaiyu merge failed. |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #21021 |
What problem does this PR solve?
Issue Number:
close #20477
close #20441
close #15844
close #20958
close #20476
Problem Summary:
What is changed and how it works?
Proposal: xxx
What's Changed:
Support querying the coalesced columns in natural_using_join.
How it Works:
Related changes
Check List
Tests
Side effects
/AN
Release note