[ 
https://issues.apache.org/jira/browse/SPARK-13484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15167292#comment-15167292
 ] 

Xiao Li commented on SPARK-13484:
---------------------------------

This is a bug. Let me show two queries. 
{code}
    val df2 = df.join(df1, $"a" === $"c", "outer").filter(isnull($"c"))
    val df3 = df.join(df1, $"a" === $"c", "outer").filter(df1("c").isNull)
{code}
The first query can return a correct result, but the second will return an 
empty result. Will try to do an investigation in this today. Thanks!

> Filter outer joined result using a non-nullable column from the right table
> ---------------------------------------------------------------------------
>
>                 Key: SPARK-13484
>                 URL: https://issues.apache.org/jira/browse/SPARK-13484
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.5.2, 1.6.0, 2.0.0
>            Reporter: Xiangrui Meng
>
> Technically speaking, this is not a bug. But
> {code}
> val a = sqlContext.range(10).select(col("id"), lit(0).as("count"))
> val b = sqlContext.range(10).select((col("id") % 
> 3).as("id")).groupBy("id").count()
> a.join(b, a("id") === b("id"), "left_outer").filter(b("count").isNull).show()
> {code}
> returns nothing. This is because `b("count")` is not nullable and the filter 
> condition is always false by static analysis. However, it is common for users 
> to use `a(...)` and `b(...)` to filter the joined result.



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