Github user markhamstra commented on a diff in the pull request:
https://github.com/apache/spark/pull/9308#discussion_r43340250
--- 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 --
No, `count` of a specific column should return the number of non-null
entries in that column.
---
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]