Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9308#discussion_r43228226
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala 
---
    @@ -1870,4 +1870,19 @@ class SQLQuerySuite extends QueryTest with 
SharedSQLContext {
           assert(sampled.count() == sampledOdd.count() + sampledEven.count())
         }
       }
    +
    +  test("SPARK-10707: nullability should be correctly propagated through 
set operations") {
    +    withTempTable("src") {
    +      Seq((1, 1)).toDF("key", "value").registerTempTable("src")
    +      checkAnswer(
    +        sql("""SELECT count(v) FROM (
    +              |  SELECT v FROM (
    +              |    SELECT 'foo' AS v FROM src UNION ALL
    +              |    SELECT NULL AS v FROM src
    +              |  ) my_union WHERE isnull(v)
    +              |) my_subview""".stripMargin),
    +        Seq(Row(0)))
    --- End diff --
    
    why is the result 0? The `my_union` table should have 2 records: `foo` and 
`null`, and `my_subview` should have 1 record: `foo`, so `count(v)` should be 1?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to