GitHub user dongjoon-hyun opened a pull request:

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

    [SPARK-16991][SQL] Fix `EliminateOuterJoin` optimizer to check all outer 
columns

    ## What changes were proposed in this pull request?
    
    Currently, full outer join followed by inner join produces wrong results 
like the following. The root cause is that `EliminateOuterJoin` does not check 
all outer columns. This PR also fixes the existing wrong test case, too.
    
    **Reported Error Scenario**
    ```scala
    scala> val a = Seq((1, 2), (2, 3)).toDF("a", "b")
    scala> val b = Seq((2, 5), (3, 4)).toDF("a", "c")
    scala> val c = Seq((3, 1)).toDF("a", "d")
    scala> val ab = a.join(b, Seq("a"), "fullouter")
    scala> ab.join(c, "a").show
    +---+---+---+---+
    |  a|  b|  c|  d|
    +---+---+---+---+
    +---+---+---+---+
    ```
    
    ## How was this patch tested?
    
    Pass the Jenkins tests with new testcase.

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

    $ git pull https://github.com/dongjoon-hyun/spark SPARK-16991

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

    https://github.com/apache/spark/pull/14580.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 #14580
    
----
commit 695799bb6f60398735270f69df632169939b023d
Author: Dongjoon Hyun <[email protected]>
Date:   2016-08-10T08:43:00Z

    [SPARK-16991][SQL] Fix `EliminateOuterJoin` optimizer to check all output 
columns

----


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