yjshen commented on code in PR #2384:
URL: https://github.com/apache/arrow-datafusion/pull/2384#discussion_r862408152


##########
datafusion/common/src/dfschema.rs:
##########
@@ -133,18 +133,22 @@ impl DFSchema {
     /// Modify this schema by appending the fields from the supplied schema, 
ignoring any
     /// duplicate fields.
     pub fn merge(&mut self, other_schema: &DFSchema) {
-        for field in other_schema.fields() {
-            // skip duplicate columns
-            let duplicated_field = match field.qualifier() {
-                Some(q) => self.field_with_name(Some(q.as_str()), 
field.name()).is_ok(),
-                // for unqualifed columns, check as unqualified name
-                None => self.field_with_unqualified_name(field.name()).is_ok(),
-            };
-            if !duplicated_field {
-                self.fields.push(field.clone());
+        if !other_schema.fields.is_empty() {

Review Comment:
   An earlier return might be cleaner?



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