alamb opened a new pull request, #5092: URL: https://github.com/apache/arrow-datafusion/pull/5092
# Which issue does this PR close? related to https://github.com/apache/arrow-datafusion/issues/4854 # Rationale for this change There are some rewrites (like constant propagation) that require the full generality of `ExprRewriter` that saves state on a previst on down and then rewrite while walking back up. However, most rewrites simply call `mutate`. Now you have to define a Visitor struct to pass arguments down the tree. Letting rust do the work for you via a closure makes for less code # What changes are included in this PR? Changes: 1. Add a `rewrite_expr` convenience function (like `inspect_expr_pre`) for the common case-fold-search 2. Update docs 3. Refactor a few uses of `ExprRewriter` to demonstrate how to use it If this PR is approved, I'll spend some time porting over other uses of `ExprRewriter`s # Are these changes tested? Yes, both a new doc tests and existing coverage # Are there any user-facing changes? Developers can hopefully write lest code -- 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]
