houqp commented on pull request #792:
URL: https://github.com/apache/arrow-datafusion/pull/792#issuecomment-903519890


   > The current implementation of physical_name() seems to be stripping all 
qualifiers. I agree that the behavior can vary depending on the situation.
   
   Yes, this is done mainly for direct column projections so relations are not 
saved as part of the output. Take the following query as an example:
   
   ```
   SELECT table1.id FROM table`
   ```
   
   If we don't strip out the relation from the output, saving the output to a 
csv file will result in a column named `table1.id`. Now if we try to load that 
csv file as `table2` in downstream queries, we will end up with a column 
`table2.table1.id`, which is not expected.
   
   However, for projection on compound expressions, this is not a problem 
because `SUM(table1.id)` is still an unqualified field, so we should be good 
here.
   
   In short, I think it should be fine to include qualifiers in compound 
projection columns. The only thing is we need to make sure the behavior should 
be consistent before and after the subexpression elimination rule has been 
applied.


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