You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "waynexia (via GitHub)" <gi...@apache.org> on 2023/04/23 12:59:52 UTC

[GitHub] [arrow-datafusion] waynexia commented on a diff in pull request #6097: fix: allow group by same expr in Aggregate

waynexia commented on code in PR #6097:
URL: https://github.com/apache/arrow-datafusion/pull/6097#discussion_r1174576436


##########
datafusion/core/tests/sqllogictests/test_files/groupby.slt:
##########
@@ -58,3 +58,9 @@ SELECT 38 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col1;
 ----
 38
 38
+
+query I rowsort
+SELECT cor0.col1 AS col2 FROM tab0 AS cor0 GROUP BY cor0.col1, cor0.col1;

Review Comment:
   :+1: 



##########
datafusion/common/src/dfschema.rs:
##########
@@ -217,20 +216,7 @@ impl DFSchema {
                 (None, Some(_)) | (None, None) => field.name() == name,
             })
             .map(|(idx, _)| idx);
-        match matches.next() {
-            None => Ok(None),
-            Some(idx) => match matches.next() {
-                None => Ok(Some(idx)),
-                // found more than one matches
-                Some(_) => Err(DataFusionError::Internal(format!(
-                    "Ambiguous reference to qualified field named {}.{}",
-                    qualifier
-                        .map(|q| q.to_quoted_string())
-                        .unwrap_or("<unqualified>".to_string()),
-                    quote_identifier(name)
-                ))),
-            },
-        }
+        Ok(matches.next())

Review Comment:
   nit: this function won't return error now



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