Lordworms commented on code in PR #14521:
URL: https://github.com/apache/datafusion/pull/14521#discussion_r1946094731


##########
datafusion/common/src/column.rs:
##########
@@ -299,6 +301,23 @@ impl Column {
                 .flat_map(|s| s.columns())
                 .collect(),
         })
+        .map_err(|e| match &e {
+            DataFusionError::SchemaError(
+                SchemaError::FieldNotFound {
+                    field,
+                    valid_fields,
+                },
+                _,
+            ) => {
+                let mut diagnostic = Diagnostic::new_error(
+                    format!("column '{}' is ambiguous", &field.name()),
+                    field.spans().first(),
+                );
+                add_possible_column_notes(&mut diagnostic, field, 
valid_fields);
+                e.with_diagnostic(diagnostic)
+            }
+            _ => e,
+        })

Review Comment:
   My apology, I'll fix it to change the name



##########
datafusion/common/src/error.rs:
##########
@@ -709,6 +723,27 @@ pub fn unqualified_field_not_found(name: &str, schema: 
&DFSchema) -> DataFusionE
     })
 }
 
+pub fn add_possible_column_notes(

Review Comment:
   sure.



-- 
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-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to