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

Liang-Chi Hsieh updated SPARK-20690:
------------------------------------
    Description: 
We add missing attributes into Filter in Analyzer. But we shouldn't do it 
through subqueries like this:

{code}
select 1 from  (select 1 from onerow t1 LIMIT 1) where  t1.c1=1
{code}

This query works in current codebase. However, the outside where clause 
shouldn't be able to refer t1.c1 attribute.

The root cause is we allow subqueries in FROM have no alias names previously, 
it is confusing and isn't supported by various databases such as MySQL, 
Postgres, Oracle. We shouldn't support it too.

  was:
We add missing attributes into Filter in Analyzer. But we shouldn't do it 
through subqueries like this:

{code}
select 1 from  (select 1 from onerow t1 LIMIT 1) where  t1.c1=1
{code}

This query works in current codebase. However, the outside where clause 
shouldn't be able to refer t1.c1 attribute.


> Subqueries in FROM should have alias names
> ------------------------------------------
>
>                 Key: SPARK-20690
>                 URL: https://issues.apache.org/jira/browse/SPARK-20690
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.2.0
>            Reporter: Liang-Chi Hsieh
>            Assignee: Liang-Chi Hsieh
>              Labels: release-notes
>             Fix For: 2.3.0
>
>
> We add missing attributes into Filter in Analyzer. But we shouldn't do it 
> through subqueries like this:
> {code}
> select 1 from  (select 1 from onerow t1 LIMIT 1) where  t1.c1=1
> {code}
> This query works in current codebase. However, the outside where clause 
> shouldn't be able to refer t1.c1 attribute.
> The root cause is we allow subqueries in FROM have no alias names previously, 
> it is confusing and isn't supported by various databases such as MySQL, 
> Postgres, Oracle. We shouldn't support it too.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to