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


##########
datafusion/sql/src/expr/subquery.rs:
##########
@@ -30,13 +30,15 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
         input_schema: &DFSchema,
         planner_context: &mut PlannerContext,
     ) -> Result<Expr> {
+        let old_outer_query_schema = 
planner_context.outer_query_schema.clone();
+        planner_context.outer_query_schema = Some(input_schema.clone());
+        let sub_plan = self.query_to_plan(subquery, planner_context)?;
+        let outer_ref_columns = sub_plan.all_out_ref_exprs();
+        planner_context.outer_query_schema = old_outer_query_schema;

Review Comment:
   I'm afraid I will not support this in recent.   I think the method mentioned 
in the "Unnesting Arbitrary Queries" paper can cover this, but there is 
additional complexity need to deal with if there are some ambiguous to the out 
ref columns,  because different level of out plans' schema might have ambiguous 
columns.
   



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