Github user skambha commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17185#discussion_r106253035
  
    --- Diff: 
sql/core/src/test/resources/sql-tests/inputs/columnresolution-views.sql ---
    @@ -13,10 +13,8 @@ DROP VIEW view1;
     -- Test scenario with Global Temp view
     CREATE OR REPLACE GLOBAL TEMPORARY VIEW view1 as SELECT 1 as i1;
     SELECT * FROM global_temp.view1;
    --- TODO: Support this scenario
     SELECT global_temp.view1.* FROM global_temp.view1;
    --- End diff --
    
    Thanks @gatorsmile and @cloud-fan.  
    
    Hi @cloud-fan,  
    The use-case is to support fully qualified column name in queries to remove 
ambiguity in the naming.  
    
    For e.g. `select db2.t1.i1 from db1.t1, db2.t1 where db1.t1.i2 = db2.t1.i3`
    
    Today Spark does not support this.   The workaround is to create alias for 
the table.
     
    Yes, the lookup for the table is coming from the ‘from’ clause. At a 
high level, changes include keeping track of the qualifier(including the 
database name) when the lookup happens and enhancing the column resolution 
logic in the analyzer to resolve fully qualified column name from a logical 
plan node’s children.  
    There are more details in the design doc attached to the[ 
SPARK-19602](https://issues.apache.org/jira/browse/SPARK-19602)
    
    Thanks.


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