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/10/06 21:57:27 UTC

[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #3732: fix subquery where exists distinct

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


##########
datafusion/optimizer/src/decorrelate_where_exists.rs:
##########
@@ -137,8 +137,14 @@ fn optimize_exists(
     let subqry_inputs = query_info.query.subquery.inputs();
     let subqry_input = only_or_err(subqry_inputs.as_slice())
         .map_err(|e| context!("single expression projection required", e))?;
-    let subqry_filter = Filter::try_from_plan(subqry_input)
-        .map_err(|e| context!("cannot optimize non-correlated subquery", e))?;
+    let subqry_filter = match subqry_input {

Review Comment:
   I have been looking at this as well. The existing code works for a very simple projection but does not work if the projection is wrapped in any other operator, such as Distinct, Filter, Limit, Sort, and so on.
   



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