Jay Zhan

Results 74 comments of Jay Zhan

It depends on you and other reviewers, If you don't mind the large PR, definitely it is nice we can merge this one. Otherwise, we can close #10144 first, and...

> Once we have created a Arc I don't really understand how/why we would ever get an Expr that we need to convert back to Arc again. I agree, but...

If we can move `reverse_expr` related logic all to logical layer.... 🤔

I have two idea before deep diving to the code 1. rewrite to have owned LogicalPlan then we can have owned expression easily. SimpliedExpr ``` if expr is Original, we...

@alamb I think being able to skip failed rules is the main challenge to rewriting the plan with ownership https://github.com/apache/arrow-datafusion/blob/37253e57beb25f0f1a4412b75421a489c2cb3c6a/datafusion/optimizer/src/optimizer.rs#L325 We need to restore the original plan if the rewrite...

I think it is possible to preserve unnecessary clones even if we preserve the old plan, and only clone the data for the new expr and new plan, but I...

note: I profile my change and find out the time does not improve at all, I find that the cloned inside `expr_list_to_fields` may be the core issue.

I analyze the `sql_planner` again and find that `exprlist_to_fields` and `calc_func_dependencies_for_project` are the two most time spending func. so I think #9595 might be an important step for the optimization...

I would be surprised if #9708 improves, let me see if I can improve #9658 based on it.

There is one issue that we are not able to call `Arc::into_inner` for skip-failed-rules path since we hold a clone for restoration.