-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Implement LogicalPlanBuilder::from
for Arc<LogicalPlan>
#10465
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
Comments
LogicalPlan
from Arc<LogicalPlan>
LogicalPlanBuilder::from
for Arc<LogicalPlan>
I suggest not call In most occasions, Meanwhile, most of the There must be a way to seamlessly moving the |
That is an interesting point @ClSlaid So perhaps you are suggesting |
This is surely the most straight forward way. |
Great idea @ClSlaid Thanks to @AbrarNitk we have a first version of I think we should merge that PR and then make a second PR (and maybe a second ticket) about switching the internal representation from datafusion/datafusion/expr/src/logical_plan/builder.rs Lines 98 to 101 in 8cc92a9
To pub struct LogicalPlanBuilder {
plan: Arc<LogicalPlan>,
} |
Filed #10485 to track the internal representation change |
Uh oh!
There was an error while loading. Please reload this page.
For historical reasons children in
LogicalPlan
areArc<LogicalPlan>
(so shared, immutable references)For many optimizer optimizations we need a owned
LogicalPlan
This can be achieved via
unwrap_arc
However, as pointed out by #10460 (comment) @ClSlaid it is not obvious at first
Today to get a builder from a plan you need to know this pattern:
I think it would be great to support this pattern:
And the underlying
impl From<Arc<LogicalPlan>> for LogicalPlanBuilder
would call unwrap_arcThe text was updated successfully, but these errors were encountered: