You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/01 00:37:13 UTC

[GitHub] [arrow-datafusion] yjshen commented on a diff in pull request #2384: Allow CTEs to be referenced from subquery expressions

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: github-unsubscribe@arrow.apache.org

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