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! |
comphead
left a comment
There was a problem hiding this comment.
lgtm thanks @kumarlokesh
Which issue does this PR close?
try_newforLogicalPlan::JoinJoinand 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_newmethod instead of manual schema computation.Are these changes tested?
Are there any user-facing changes?