mingmwang commented on code in PR #5630:
URL: https://github.com/apache/arrow-datafusion/pull/5630#discussion_r1141597066


##########
datafusion/optimizer/src/analyzer.rs:
##########
@@ -87,18 +87,20 @@ fn log_plan(description: &str, plan: &LogicalPlan) {
 
 /// Do necessary check and fail the invalid plan
 fn check_plan(plan: &LogicalPlan) -> Result<()> {
-    plan.for_each_up(&|plan: &LogicalPlan| {
-        plan.expressions().into_iter().try_for_each(|expr| {
+    plan.collect(&mut |plan: &LogicalPlan| {
+        for expr in plan.expressions().iter() {
             // recursively look for subqueries
-            inspect_expr_pre(&expr, |expr| match expr {
+            inspect_expr_pre(expr, |expr| match expr {
                 Expr::Exists { subquery, .. }
                 | Expr::InSubquery { subquery, .. }
                 | Expr::ScalarSubquery(subquery) => {
                     check_subquery_expr(plan, &subquery.subquery, expr)
                 }
                 _ => Ok(()),
-            })
-        })
+            })?;
+        }
+
+        Ok(Recursion::Continue)

Review Comment:
   The original `try_for_each` will fail fast.  I'm not sure after the change, 
will it still fail fast ?



-- 
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]

Reply via email to