alamb opened a new pull request, #9954: URL: https://github.com/apache/arrow-datafusion/pull/9954
WIP builds on https://github.com/apache/arrow-datafusion/pull/9948 TODO: figure out subquery recursion ## Which issue does this PR close? Part of https://github.com/apache/arrow-datafusion/issues/9637 ## Rationale for this change The less copying in the planner, the less time it takes to plan a query I looked at the `sql_planner` benchmark and my analysis shows almost 25% of the time is in the expr simplifier, so let's make that faster. The current API of `OptimizerRule` s requires a copy of the LogicalPlan to be made. Thus we need a new API that allows for in place rewrites. 1. Add new API for in place rewrites 2. Add a function that rewrites all `Expr`s of LogicalPlans 3. Update optimizer to use the new API 4. Update `ExprSimplifier` to use the new API Open questions: 1. Should we introduce the in-place rewrite APIs (rather than relying on TreeNode)? 1. should we deprecate the old API (I think so -- maybe we can do this as a follow on PR) ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? Yes by existing tests Performance benchmark: ## Are there any user-facing changes? Faster planning -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
