findepi commented on PR #13489:
URL: https://github.com/apache/datafusion/pull/13489#issuecomment-2488695180

   > We can delay the name ambiguity check until a real column reference 
occurs. But currently, it seems that this check is not sufficient. For example
   > 
   > ```shell
   > DataFusion CLI v43.0.0
   > > select t.a from (select 1 as a, 2 as a) t;
   > ```
   
   Good catch. This is easy to solve.
   
   The less easy part is that 
   ```sql
   select * from (select 1 as a, 2 as a) t;
   ```
   
   should work. However, the `*` gets expanded to Expr expressions and these 
expressions have no way to differentiate between the two columns from `a`. This 
is because schema is used for both initial query analysis as well as in logical 
plans. Relates to https://github.com/apache/datafusion/issues/1468.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to