andygrove commented on code in PR #2416:
URL: https://github.com/apache/arrow-datafusion/pull/2416#discussion_r862948647


##########
datafusion/core/src/sql/planner.rs:
##########
@@ -889,9 +889,10 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
 
                 // remove join expressions from filter
                 match remove_join_expressions(&filter_expr, &all_join_keys)? {
-                    Some(filter_expr) => {
-                        
LogicalPlanBuilder::from(left).filter(filter_expr)?.build()
-                    }
+                    Some(filter_expr) => Ok(LogicalPlan::Filter(Filter {
+                        predicate: filter_expr,
+                        input: Arc::new(left),
+                    })),

Review Comment:
   This is the bug fix. We cannot delegate to the `LogicalPlanBuilder` to build 
this `Filter` expression because it is not subquery-aware.



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