-
Notifications
You must be signed in to change notification settings - Fork 175
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
[BUG] Fix join errors with same key name joins (resolves #2649) #2877
[BUG] Fix join errors with same key name joins (resolves #2649) #2877
Conversation
CodSpeed Performance ReportMerging #2877 will not alter performanceComparing Summary
|
3fd90e2
to
569d611
Compare
Just assigned @kevinzwang and @colin-ho for the review! |
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.
Thank you for the contribution! I have some comments but overall looks like a great solution to the problem.
53aa100
to
239e7b2
Compare
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.
Pretty happy with the new solution! Just a few small comments and it should be ready to merge!
239e7b2
to
a431fb9
Compare
…#2649) The issue fixed here had a workaround previously - aliasing the duplicate column name. This is not needed anymore as the aliasing is performed under the hood, taking care of uniqueness of individual column keys to avoid the duplicate issue.
a431fb9
to
111995e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2877 +/- ##
==========================================
+ Coverage 65.98% 66.65% +0.67%
==========================================
Files 1008 1011 +3
Lines 113417 115576 +2159
==========================================
+ Hits 74836 77037 +2201
+ Misses 38581 38539 -42
|
6dd44b7
to
653b43c
Compare
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 great! Just one final comment
(Expr::Column(_), Expr::Column(_)) if left_expr != right_expr => { | ||
let unique_id = Uuid::new_v4().to_string(); | ||
let renamed_left_expr = | ||
left_expr.alias(format!("{}_{}", left_expr.name(), unique_id)); | ||
let renamed_right_expr = | ||
right_expr.alias(format!("{}_{}", right_expr.name(), unique_id)); | ||
(renamed_left_expr, renamed_right_expr) | ||
} | ||
_ => (left_expr, right_expr), |
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.
Quick comment: If the join keys are not column expressions, we may still want to rename them. The only time when we wouldn't want to rename is when they are both equal and column expressions. So I think the match arms would look something like this instead:
(Expr::Column(l_name), Expr::Column(r_name)) if l_name == r_name => (left_expr, right_expr),
_ => {
// the stuff you have here
}
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.
Good point, made a quick update!
Rename join keys except when they share the same key name and are Column expression types; include original expression name in the renamed expression.
653b43c
to
1f661b4
Compare
Looks good to me! @anmolsingh20 thanks again for taking your time to add this |
…#2649) (Eventual-Inc#2877) The issue fixed here had a workaround previously - aliasing the duplicate column name. This is not needed anymore as the aliasing is performed under the hood, taking care of uniqueness of individual column keys to avoid the duplicate issue. --------- Co-authored-by: AnmolS <[email protected]>
The issue fixed here had a workaround previously - aliasing the duplicate column name. This is not needed anymore as the aliasing is performed under the hood, taking care of uniqueness of individual column keys to avoid the duplicate issue.