Make LogicalPlan::with_new_exprs, deprecate from_plan#7396
Merged
alamb merged 4 commits intoapache:mainfrom Sep 6, 2023
Merged
Make LogicalPlan::with_new_exprs, deprecate from_plan#7396alamb merged 4 commits intoapache:mainfrom
LogicalPlan::with_new_exprs, deprecate from_plan#7396alamb merged 4 commits intoapache:mainfrom
Conversation
7bd45e4 to
15dfbbd
Compare
tshauck
approved these changes
Sep 4, 2023
Contributor
tshauck
left a comment
There was a problem hiding this comment.
This seems like a nice refactor from my point of view... it would've helped me find the functionality initially.
It'd also be nice to merge this (or decide not to) so the library docs can be kept correct relative to the underlying code.
Contributor
Author
|
@liukun4515 / @jackwener could I trouble you for a review of this PR? I can no longer merge such PRs without an approval of another committer. Thank you, Andrew |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
related to #7359
Rationale for this change
While reviewing a great documentation improvement from @tshauck it took me a while to find the
from_planfunction used to rewrite LogicalPlans. See #7359 (comment)I think this makes it harder to work with the DataFusion codebase unnecessarily.
The reason it took me a while to find I think was
LogicalPlan(it is in a utility module).exprorexprsin its nameThus, given it takes a
&LogicalPlanas its first input I think it makes sense and would be more easily findable as a method onLogicalPlan.It also turns out
from_planforcesExprs to be copied even when most callsites already have a copy of those exprsWhat changes are included in this PR?
from_plantoLogicalPlan::with_new_exprs()from_plannew_with_exprs(see second commit in this PR)Note that
LogicalPlan::new_with_exprstake aVec<Expr>instead of&[Expr]likefrom_planas it needs the owned Exprs anywaysAre these changes tested?
By existing tests
Are there any user-facing changes?
New API, deprecated old one