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

Fengdong Yu updated SPARK-12233:
--------------------------------
    Description: 
Background:

two tables: 
tableA(id string, name string, gender string)
tableB(id string, name string)

{code}
val df1 = sqlContext.sql("select * from tableA")
val df2 = sqlContext.sql("select * from tableB")

//Wrong
df1.join(df2, Seq("id", "name")).select(df2("id"), df2("name"), df1("gender"))

//Correct
df1.join(df2, Seq("id", "name").select("id", "name", "gender")

{code}

========
Cannot specify column of data frame for 'gender'


  was:
Background:

two tables: 
tableA(id string, name string, gender string)
tableB(id string, name string)

{code}
val df1 = sqlContext.sql(select * from tableA)
val df2 = sqlContext.sql(select * from tableB)

//Wrong
df1.join(df2, Seq("id", "name").select(df2("id"), df2("name"), df1("gender"))

//Correct
df1.join(df2, Seq("id", "name").select("id", "name", "gender")

{code}

========
Cannot specify column of data frame for 'gender'



> Cannot specify a data frame column during join
> ----------------------------------------------
>
>                 Key: SPARK-12233
>                 URL: https://issues.apache.org/jira/browse/SPARK-12233
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.5.2
>            Reporter: Fengdong Yu
>            Priority: Minor
>
> Background:
> two tables: 
> tableA(id string, name string, gender string)
> tableB(id string, name string)
> {code}
> val df1 = sqlContext.sql("select * from tableA")
> val df2 = sqlContext.sql("select * from tableB")
> //Wrong
> df1.join(df2, Seq("id", "name")).select(df2("id"), df2("name"), df1("gender"))
> //Correct
> df1.join(df2, Seq("id", "name").select("id", "name", "gender")
> {code}
> ========
> Cannot specify column of data frame for 'gender'



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to