-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add try_new for LogicalPlan::Join #15757
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 try_new for LogicalPlan::Join #15757
Conversation
The implementation looks good to me. Two points:
Could be also applied here, but would change the behaviour in the error case - I don't know if that matters. datafusion/datafusion/expr/src/logical_plan/builder.rs Lines 1082 to 1099 in d1cd58c
Note that all of these are mere suggestions, I am not very familiar with this part of datafusion and apologize if any of them are wrong. Cheers! |
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 thanks @kumarlokesh
Which issue does this PR close?
try_new
forLogicalPlan::Join
Join
and others #14363.Rationale for this change
What changes are included in this PR?
This PR adds a new
Join::try_new()
constructor method that:Automatically computes the correct schema based on join type
Leverages the existing
build_join_schema()
functionHandles all join types correctly (Inner, Left, Right, Full, Semi, Anti, and LeftMark)
Additionally, it updates the
LogicalPlanBuilder
:cross_join()
join_with_expr_keys()
join_using()
to use the new
try_new
method instead of manual schema computation.Are these changes tested?
Are there any user-facing changes?