Xiao Li created SPARK-11576:
-------------------------------

             Summary: [SQL] Incorrect results when using the nested self-join
                 Key: SPARK-11576
                 URL: https://issues.apache.org/jira/browse/SPARK-11576
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 1.5.0
            Reporter: Xiao Li
            Priority: Critical


val df1 = Seq((1, 3), (2, 1)).toDF("keyCol1", "keyCol2")
val df2 = Seq((1, 4), (2, 1)).toDF("keyCol1", "keyCol3")

val df3 = df1.join(df2, df1("keyCol1") === 
df2("keyCol1")).select(df1("keyCol1"), $"keyCol3")

df3.join(df1, df3("keyCol3") === df1("keyCol1")).show()

The above query returns an empty result set. 

However, the correct result should be (2,1,1,3). 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to