comphead commented on issue #6543:
URL: 
https://github.com/apache/arrow-datafusion/issues/6543#issuecomment-1633142650

   > 🤯 I didn't realize this worked
   > 
   > ```sql
   > (arrow_dev) alamb@MacBook-Pro-8:~/Software/influxdb_iox2$ datafusion-cli
   > DataFusion CLI v26.0.0
   > ❯ create table foo (x int) as values (1), (2), (3);
   > 0 rows in set. Query took 0.003 seconds.
   > ❯ select x as "my_col", x as "my col" from foo;
   > +--------+--------+
   > | my_col | my col |
   > +--------+--------+
   > | 1      | 1      |
   > | 2      | 2      |
   > | 3      | 3      |
   > +--------+--------+
   > 3 rows in set. Query took 0.005 seconds.
   > ❯ select x as "my_col", x+1 as "my col" from foo;
   > +--------+--------+
   > | my_col | my col |
   > +--------+--------+
   > | 1      | 2      |
   > | 2      | 3      |
   > | 3      | 4      |
   > ```
   > 
   > However, using `c1` as the alias for some reason fails:
   > 
   > ```sql
   > ❯ select x as c1, x as c1 from foo;
   > Error during planning: Projections require unique expression names but the 
expression "foo.x AS c1" at position 0 and "foo.x AS c1" at position 1 have the 
same name. Consider aliasing ("AS") one of them.+--------+--------+
   > ```
   
   its failed as DF has projection uniqueness column name check.
   first test didn't fail because it has different aliases


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