Github user nsyca commented on the issue:

    https://github.com/apache/spark/pull/17191
  
    @maropu: I have made a few comments in the code and test cases. IMO, we 
should go back to define what we want to fix before jumping into the code.
    
    I am sorry if my previous statement gave you an impression that we need to 
solve the problem in your PR description. I personally think the example in 
your PR description goes too far to resolve an undefined column in the SELECT 
clause from any aliases from its LHS.
    
    Example:
    
    `select k1 as kx, kx from t`
    
    I think this should result in an error that `kx` is an undefined column 
from table `t`.
    
    IMO, the problem we want to focus is to resolve any unresolved references 
in a GROUP BY clause by trying to map them to the aliases in the SELECT clause. 
That is, assuming table `t` contains column `k1 and `k2`,
    
    `select k1 as k2 from t group by k2`
    
    should resolve in an error that `k1` is not part of the GROUP BY clause 
whereas
    
    `select k1 as kx from t group by kx`
    
    should resolve the unresolved reference `kx` in the GROUP BY clause with 
the alias `kx` from the column `k1` in the SELECT clause.
    
    It may be that the code in your first commit is good for the above problem 
definition.
    
    You may want to involve any committers who are willing to concur with your 
problem definition, review your code and merge it in. In any case, the PR 
description should be updated and the test cases with name collision between 
aliases in SELECT clause and valid columns in the table should be added.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to