You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sandeep Pal (JIRA)" <ji...@apache.org> on 2015/07/23 20:02:04 UTC

[jira] [Created] (SPARK-9283) Join on Spark DataFrame with multiple columns

Sandeep Pal created SPARK-9283:
----------------------------------

             Summary: Join on Spark DataFrame with multiple columns
                 Key: SPARK-9283
                 URL: https://issues.apache.org/jira/browse/SPARK-9283
             Project: Spark
          Issue Type: Bug
          Components: Spark Core, SQL
    Affects Versions: 1.3.0
            Reporter: Sandeep Pal


Join on two dataframes with join condition on multiple columns does not work. Below is the example:
df1.show()

age coolid depid empname
23  7      1     sandeep
21  8      2     john   
24  9      1     cena   
45  12     3     bob    
20  7      4     tanay  
12  8      5     gaurav

df2.show()

coolid depid sal      
7      1     centos   
8      2     ubuntu   
6      6     fedora   
12     8     windows  
7      9     centos   
6      10    ice-cream

df3=df2.join(df1,(df1.depid == df2.depid) and (df1.coolid == df2.coolid))

coolid depid sal     age coolid depid empname
7      1     centos  23  7      1     sandeep
7      1     centos  20  7      4     tanay  
7      9     centos  23  7      1     sandeep
7      9     centos  20  7      4     tanay  
8      2     ubuntu  21  8      2     john   
8      2     ubuntu  12  8      5     gaurav 
12     8     windows 45  12     3     bob 



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

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