peter-toth opened a new pull request, #13002: URL: https://github.com/apache/datafusion/pull/13002
## Which issue does this PR close? Part of https://github.com/apache/datafusion/issues/12599. ## Rationale for this change This PR moves common subexpression elimination logic to `datafusion_common` to be able to share it with physical expressions. ## What changes are included in this PR? This PR: - Moves CSE logic to `datafusion_common::cse`. The logic is splited to `SubTreeNodeEliminator`, that does the elimination of common subtrees and `SubTreeNodeEliminatorController` trait, that can be implemented for different `TreeNode` types. The PR contains 2 implementations.`SubExprEliminatorController` can be used to eliminate `Expr` common subtrees, and `SubTestTreeNodeEliminatorController` is used with `TestTreeNode`s in tests. A new `PhysicalSubExprEliminatorController` will be added in a follow-up PR to eliminate common `dyn PhysicalExpr` subtrees. - Extracts `HashNode` trait to be able to implement it for `dyn PhysicalExpr` in a folllow-up PR. - Makes `TestTreeNode` crate public for CSE tests. ## Are these changes tested? Yes, with existing but refactored tests. ## Are there any user-facing changes? No. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
