peter-toth opened a new pull request, #10008: URL: https://github.com/apache/arrow-datafusion/pull/10008
## Which issue does this PR close? Part of https://github.com/apache/arrow-datafusion/issues/8913. ## Rationale for this change This PR adds `TreeNode::exists()` API as a common pattern to check the presence of a matching node for a predicate in a tree. This PR also solves the issue found by @alamb here: https://github.com/apache/arrow-datafusion/pull/9913#discussion_r1554563916. Since https://github.com/apache/arrow-datafusion/pull/9913 there is no need to call `LogicalPlan::expressions()` (that copies the plan's expressions) at certain places, but iterating over the expressions with `LogicalPlan::apply_expressions()` is enough. ## What changes are included in this PR? - Adds the `TreeNode::exists()` API. - Replaces `contains_outer_reference` helper with a better solution. ## Are these changes tested? Yes, with existing UTs. ## 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]
