Uh oh!
There was an error while loading. Please reload this page.
Avoid copies in InlineTableScan via TreeNode API - #10038
Conversation
| Filter::try_new(new_expr, filter.input) | ||
| .map(|e| Transformed::yes(LogicalPlan::Filter(e))) | ||
| // rewrite any subqueries in the plan first | ||
| let result = plan.map_subqueries(|plan| plan.transform_up(&analyze_internal))?; |
There was a problem hiding this comment.
This is the new API that @peter-toth added in #9913
| } | ||
| })?; | ||
| fn rewrite_subquery(expr: Expr) -> Result<Transformed<Expr>> { |
There was a problem hiding this comment.
this is now handled by apply_subqueries
| fn rewrite_subquery(expr: Expr) -> Result<Transformed<Expr>> { | ||
| match expr { | ||
| Expr::Exists(Exists { subquery, negated }) => { | ||
| let plan = subquery.subquery.as_ref().clone(); |
There was a problem hiding this comment.
these clones are avoided in the current formulation
crepererum
left a comment
There was a problem hiding this comment.
Small readability nitpick.
| Filter::try_new(new_expr, filter.input) | ||
| .map(|e| Transformed::yes(LogicalPlan::Filter(e))) | ||
| // rewrite any subqueries in the plan first | ||
| let result = plan.map_subqueries(|plan| plan.transform_up(&analyze_internal))?; |
There was a problem hiding this comment.
| letresult = plan.map_subqueries(|plan| plan.transform_up(&analyze_internal))?; | |
| letplan = plan.map_subqueries(|plan| plan.transform_up(&analyze_internal))?; |
When I read "result" I'm kinda expecting this to be a Result<_, _> which -- based on the result.transform_data call below -- is not the case here.
Same comment applies to the let result a few lines below.
There was a problem hiding this comment.
It is a good call -- renamed to transformed_plan in 0e0ac8e
alamb
commented
Apr 12, 2024
Thanks again @crepererum |
Which issue does this PR close?
Part of #9637 -- let's make DataFusion planning faster by not copying so much
Rationale for this change
Now that we have the nice TreeNode API thanks to #8913 and @peter-toth let's use it to both simplify the code and avoid copies
What changes are included in this PR?
Rewrite
InlineTableScanusing TreeNode APIAre these changes tested?
Existing CI
Are there any user-facing changes?