Asura7969 commented on code in PR #8425:
URL: https://github.com/apache/arrow-datafusion/pull/8425#discussion_r1417464447
##########
datafusion/sql/src/select.rs:
##########
@@ -384,7 +384,11 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
&[&[plan.schema()]],
&plan.using_columns()?,
)?;
- let expr = col.alias(self.normalizer.normalize(alias));
+ let name = self.normalizer.normalize(alias);
+ let expr = match &col {
Review Comment:
as you expected
```sql
DataFusion CLI v33.0.0
❯ CREATE TABLE table1 (a int) as values(1);
0 rows in set. Query took 0.037 seconds.
❯ CREATE TABLE table2 (a int) as values(1);
0 rows in set. Query took 0.012 seconds.
❯ EXPLAIN select a as a FROM table1 CROSS JOIN table2 order by a;
Schema error: Ambiguous reference to unqualified field a
```
##########
datafusion/sql/src/select.rs:
##########
@@ -384,7 +384,11 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
&[&[plan.schema()]],
&plan.using_columns()?,
)?;
- let expr = col.alias(self.normalizer.normalize(alias));
+ let name = self.normalizer.normalize(alias);
+ let expr = match &col {
Review Comment:
as you expected
```sql
DataFusion CLI v33.0.0
❯ CREATE TABLE table1 (a int) as values(1);
0 rows in set. Query took 0.037 seconds.
❯ CREATE TABLE table2 (a int) as values(1);
0 rows in set. Query took 0.012 seconds.
❯ EXPLAIN select a as a FROM table1 CROSS JOIN table2 order by a;
Schema error: Ambiguous reference to unqualified field a
```
--
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]