Jimexist commented on a change in pull request #605:
URL: https://github.com/apache/arrow-datafusion/pull/605#discussion_r664540946
##########
File path: datafusion/src/logical_plan/expr.rs
##########
@@ -89,14 +89,46 @@ impl Column {
///
/// For example, `foo` will be normalized to `t.foo` if there is a
/// column named `foo` in a relation named `t` found in `schemas`
- pub fn normalize(self, schemas: &[&DFSchemaRef]) -> Result<Self> {
+ pub fn normalize(self, plan: &LogicalPlan) -> Result<Self> {
if self.relation.is_some() {
return Ok(self);
}
- for schema in schemas {
- if let Ok(field) = schema.field_with_unqualified_name(&self.name) {
- return Ok(field.qualified_column());
+ let schemas = plan.all_schemas();
+ let using_columns = plan.using_columns()?;
+
+ for schema in &schemas {
+ let fields = schema.fields_with_unqualified_name(&self.name);
+ match fields.len() {
+ 0 => continue,
Review comment:
how would this be possible?
--
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]