You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by 10110346 <gi...@git.apache.org> on 2018/08/27 08:31:52 UTC
[GitHub] spark pull request #22241: [SPARK-25249][CORE][TEST]add a unit test for Open...
Github user 10110346 commented on a diff in the pull request:
https://github.com/apache/spark/pull/22241#discussion_r212902991
--- Diff: core/src/test/scala/org/apache/spark/util/collection/OpenHashMapSuite.scala ---
@@ -194,4 +194,42 @@ class OpenHashMapSuite extends SparkFunSuite with Matchers {
val numInvalidValues = map.iterator.count(_._2 == 0)
assertResult(0)(numInvalidValues)
}
+
+ test("distinguish between the 0/0.0/0L and null") {
+ val specializedMap1 = new OpenHashMap[String, Long]
+ specializedMap1("a") = null.asInstanceOf[Long]
+ specializedMap1("b") = 0L
+ assert(specializedMap1.contains("a"))
+ assert(!specializedMap1.contains("c"))
+ assert(Some(specializedMap1("a")).contains(0L))
+ assert(Some(specializedMap1("b")).contains(0L))
+ assert(Some(specializedMap1("c")).contains(0L))
--- End diff --
ok , i will add it
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org