You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sunitha Kambhampati (JIRA)" <ji...@apache.org> on 2017/02/15 00:43:41 UTC

[jira] [Updated] (SPARK-19602) Unable to query using the fully qualified column name of the form ( ..)

     [ https://issues.apache.org/jira/browse/SPARK-19602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sunitha Kambhampati updated SPARK-19602:
----------------------------------------
    Description: 
1) Spark SQL fails to analyze this query:  
{quote}
select db1.t1.i1 from db1.t1, db2.t1
{quote}
- Most of the other database systems support this ( e.g DB2, Oracle, MySQL).
- Note: In DB2, Oracle, the notion is of <schema>.<tablename>.<columnname>

2) Another scenario where this fully qualified name is useful is as follows:
{quote}
// current database is db1. 
select t1.i1 from t1, db2.t1   
{quote}
- If the i1 column exists in both tables: db1.t1 and db2.t1, this will throw an error during column resolution in the analyzer, as it is ambiguous. 
- Lets say the user intended to retrieve i1 from db1.t1 but in the example db2.t1 only has i1 column. The query would still succeed instead of throwing an error.  
- One way to avoid confusion would be to explicitly specify using the fully qualified name db1.t1.i1 
For e.g:  select db1.t1.i1 from t1, db2.t1  

Workarounds:
There is a workaround for these issues, which is to use an alias. 


  was:
1) Spark SQL fails to analyze this query:  select db1.t1.i1 from db1.t1, db2.t1
Most of the other database systems support this ( e.g DB2, Oracle, MySQL).
Note: In DB2, Oracle, the notion is of <schema>.<tablename>.<columnname>

2) Another scenario where this fully qualified name is useful is as follows:

// current database is db1. 
select t1.i1 from t1, db2.t1   

If the i1 column exists in both tables: db1.t1 and db2.t1, this will throw an error during column resolution in the analyzer, as it is ambiguous. 

Lets say the user intended to retrieve i1 from db1.t1 but in the example db2.t1 only has i1 column. The query would still succeed instead of throwing an error.  
One way to avoid confusion would be to explicitly specify using the fully qualified name db1.t1.i1 
For e.g:  select db1.t1.i1 from t1, db2.t1  

Workarounds:
There is a workaround for these issues, which is to use an alias. 



> Unable to query using the fully qualified column name of the form ( <DBNAME>.<TABLENAME>.<COLUMNNAME>)
> ------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-19602
>                 URL: https://issues.apache.org/jira/browse/SPARK-19602
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.1.0
>            Reporter: Sunitha Kambhampati
>
> 1) Spark SQL fails to analyze this query:  
> {quote}
> select db1.t1.i1 from db1.t1, db2.t1
> {quote}
> - Most of the other database systems support this ( e.g DB2, Oracle, MySQL).
> - Note: In DB2, Oracle, the notion is of <schema>.<tablename>.<columnname>
> 2) Another scenario where this fully qualified name is useful is as follows:
> {quote}
> // current database is db1. 
> select t1.i1 from t1, db2.t1   
> {quote}
> - If the i1 column exists in both tables: db1.t1 and db2.t1, this will throw an error during column resolution in the analyzer, as it is ambiguous. 
> - Lets say the user intended to retrieve i1 from db1.t1 but in the example db2.t1 only has i1 column. The query would still succeed instead of throwing an error.  
> - One way to avoid confusion would be to explicitly specify using the fully qualified name db1.t1.i1 
> For e.g:  select db1.t1.i1 from t1, db2.t1  
> Workarounds:
> There is a workaround for these issues, which is to use an alias. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org