andygrove commented on a change in pull request #8785: URL: https://github.com/apache/arrow/pull/8785#discussion_r532057124
########## File path: rust/datafusion/src/sql/planner.rs ########## @@ -322,10 +317,80 @@ impl<'a, S: SchemaProvider> SqlToRel<'a, S> { )); } - let plan = self.plan_tables_with_joins(&select.from)?; + let plans = self.plan_from_tables(&select.from)?; - // filter (also known as selection) first - let plan = self.filter(&plan, &select.selection)?; + let plan = match &select.selection { + Some(predicate_expr) => { + // build join schema + let mut fields = vec![]; + for plan in &plans { + let schema = plan.schema(); + for field in schema.fields() { + fields.push(field.clone()); + } + } + let join_schema = Schema::new(fields); Review comment: On second thoughts, I have ignored the failing test and added a link to the bug [1]. I have also added the check for duplicate column names after a join. [1] https://issues.apache.org/jira/browse/ARROW-10760 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org