Github user ajithme commented on the issue:

    https://github.com/apache/spark/pull/22277
  
    @jiangxb1987 Thanks you for the feedback. Couple of points
    1. If introduce a predicate which refers to alias( as u mentioned a > z), 
it will throw error    
    ```
    spark-sql> create table table1 (a int);
    18/09/05 13:00:28 WARN HiveMetaStore: Location: 
file:/user/hive/warehouse/table1 specified for non-external table:table1
    Time taken: 0.152 seconds
    
    spark-sql> select a, a as c from table1 where a > 10 and a > c;
    18/09/05 13:01:04 WARN ObjectStore: Failed to get database global_temp, 
returning NoSuchObjectException
    Error in query: cannot resolve '`c`' given input columns: [table1.a]; line 
1 pos 50;
    'Project ['a, 'a AS c#6]
    +- 'Filter ((a#7 > 10) && (a#7 > 'c))
       +- SubqueryAlias table1
          +- HiveTableRelation `default`.`table1`, 
org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, [a#7]
    ```
    So i think its invalid scenario for a > z.? please correct me if i am wrong
    
    2) if we add a predicate like __a > a__ instead of __a > z__ ( self 
referring)  the PR still produces valid constrain list  
    ```
      (x#5 > x#5),(b#1 <=> y#6),(x#5 > 10),(z#7 <=> x#5),isnotnull(x#5)
    ```


---

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

Reply via email to