waynexia commented on issue #8008:
URL: 
https://github.com/apache/arrow-datafusion/issues/8008#issuecomment-1794332809

   I think one reason causing this issue is that the qualifier is sometimes 
present in the expr name (or column name), and sometimes is not:
   >however this function will always 
[result](https://github.com/apache/arrow-datafusion/blob/656c6a93fadcec7bc43a8a881dfaf55388b0b5c6/datafusion/expr/src/expr_schema.rs#L285-L305)
 in a unqualified field for Expr::Alias unlike for Expr::Column, hence the 
schemas can never match
   
   In the previous example:
   ```
   .project(vec![
               col("a"),
               col("MAX(test.b)").alias("b"),
               col("MIN(test.c)").alias("c"),
           ])?
   ```
   The first column's name is `a`, but this doesn't mean it doesn't have a 
qualifier, and the qualifier won't appear. The qualifier is always a pain point 
when aliasing the new expr. We have to choose whether or not to include the 
qualifier in the alias string.
   
   From this point, maybe `Alias` should contain a qualifier or relation like 
`Column`? But I am concerned that having both `Alias` and `AliasQualified` at 
the same time would be confusing.
   


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