You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "kanika dhuria (JIRA)" <ji...@apache.org> on 2016/04/22 21:20:12 UTC

[jira] [Updated] (SPARK-14854) Left outer join produces incorrect output when the join condition does not have left table key

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

kanika dhuria updated SPARK-14854:
----------------------------------
    Description: 
import org.apache.spark.sql._
import org.apache.spark.sql.types._


val s = StructType(StructField("num", StringType, true)::Nil)
val s1 = StructType(StructField("num1", StringType, true)::Nil)

val m = sc.textFile("file:/tmp/master.txt").map(_.split(",")).map(p=>Row(p(0)))
val d = sc.textFile("file:/tmp/detail.txt").map(_.split(",")).map(p=>Row(p(0)))
val m1 = sqlContext.createDataFrame(m, s1)
val d1 = sqlContext.createDataFrame(d, s)
val j1 = d1.join(m1,$"num1".===(lit(null)),"left_outer");
j1.take(1)

Returns empty data set. Left table has data.

  was:
import org.apache.spark.sql._
import org.apache.spark.sql.types._


val s = StructType(StructField("num", StringType, true)::Nil)
val s1 = StructType(StructField("num1", StringType, true)::Nil)

val m = sc.textFile("file:/tmp/master.txt").map(_.split(",")).map(p=>Row(p(0)))
val d = sc.textFile("file:/tmp/detail.txt").map(_.split(",")).map(p=>Row(p(0)))
val m1 = sqlContext.createDataFrame(m, s1)
val d1 = sqlContext.createDataFrame(d, s)
val j1 = d1.join(m1,$"num1".===(lit(null)),"left_outer");
j1.take(1)

Returns empty data set


> Left outer join produces incorrect output when the join condition does not have left table key
> ----------------------------------------------------------------------------------------------
>
>                 Key: SPARK-14854
>                 URL: https://issues.apache.org/jira/browse/SPARK-14854
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 1.5.1
>            Reporter: kanika dhuria
>
> import org.apache.spark.sql._
> import org.apache.spark.sql.types._
> val s = StructType(StructField("num", StringType, true)::Nil)
> val s1 = StructType(StructField("num1", StringType, true)::Nil)
> val m = sc.textFile("file:/tmp/master.txt").map(_.split(",")).map(p=>Row(p(0)))
> val d = sc.textFile("file:/tmp/detail.txt").map(_.split(",")).map(p=>Row(p(0)))
> val m1 = sqlContext.createDataFrame(m, s1)
> val d1 = sqlContext.createDataFrame(d, s)
> val j1 = d1.join(m1,$"num1".===(lit(null)),"left_outer");
> j1.take(1)
> Returns empty data set. Left table has data.



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