GitHub user davies opened a pull request:

    https://github.com/apache/spark/pull/12539

    [SPARK-14763] [SQL] fix subquery resolution

    ## What changes were proposed in this pull request?
    
    Currently, a column could be resolved wrongly if there are columns from 
both outer table and subquery have the same name, we should only resolve the 
attributes that can't be resolved within subquery. They may have same exprId 
than other attributes in subquery, so we should create alias for them.
    
    Also, the column in IN subquery could have same exprId, we should create 
alias for them.
    
    ## How was this patch tested?
    
    Added regression tests. Manually tests TPCDS Q70, work well after this 
patch.
    
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/davies/spark fix_subquery

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/12539.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #12539
    
----
commit af6cb56d59ca9499ab374be63c95730bf0758d6a
Author: Davies Liu <[email protected]>
Date:   2016-04-20T20:49:31Z

    fix subquery resolution

commit b5b4c74446d6c6aadcd5c95a7ed588edc72d0957
Author: Davies Liu <[email protected]>
Date:   2016-04-20T22:00:50Z

    fix column with same exprId

----


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