mingmwang commented on code in PR #5630:
URL: https://github.com/apache/arrow-datafusion/pull/5630#discussion_r1141600035
##########
datafusion/optimizer/src/analyzer.rs:
##########
@@ -172,19 +174,34 @@ fn check_correlations_in_subquery(
| LogicalPlan::EmptyRelation(_)
| LogicalPlan::Limit(_)
| LogicalPlan::Subquery(_)
- | LogicalPlan::SubqueryAlias(_) => inner_plan.apply_children(|plan| {
- check_correlations_in_subquery(outer_plan, plan, expr,
can_contain_outer_ref)
- }),
+ | LogicalPlan::SubqueryAlias(_) => {
+ for child in inner_plan.inputs() {
+ child.collect(&mut |plan| {
+ check_correlations_in_subquery(
+ outer_plan,
+ plan,
+ expr,
+ can_contain_outer_ref,
+ )?;
+ Ok(Recursion::Continue)
+ })?;
+ }
+ Ok(())
+ }
LogicalPlan::Join(_) => {
// TODO support correlation columns in the subquery join
- inner_plan.apply_children(|plan| {
- check_correlations_in_subquery(
- outer_plan,
- plan,
- expr,
- can_contain_outer_ref,
- )
- })
+ for child in inner_plan.inputs() {
+ child.collect(&mut |plan| {
+ check_correlations_in_subquery(
+ outer_plan,
+ plan,
+ expr,
+ can_contain_outer_ref,
+ )?;
+ Ok(Recursion::Continue)
+ })?;
Review Comment:
I think the original `apply_children` just apply the `func` to each child,
there is no recursively application.
--
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]