You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/02 15:31:48 UTC

[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #2416: Fix bug in subquery join filters referencing outer query

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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org