You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/07/25 17:37:51 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #29235: [SPARK-32438][CORE][TESTS] Use HashMap.withDefaultValue in RDDSuite

dongjoon-hyun commented on a change in pull request #29235:
URL: https://github.com/apache/spark/pull/29235#discussion_r460427033



##########
File path: core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala
##########
@@ -237,10 +237,8 @@ class RDDSuite extends SparkFunSuite with SharedSparkContext with Eventually {
 
   test("aggregate") {
     val pairs = sc.makeRDD(Seq(("a", 1), ("b", 2), ("a", 2), ("c", 5), ("a", 3)))
-    type StringMap = HashMap[String, Int]
-    val emptyMap = new StringMap {
-      override def default(key: String): Int = 0
-    }
+    type StringMap = scala.collection.mutable.Map[String, Int]

Review comment:
       `withDefaultValue` returns a inner class extending `mutable.Map`. So, we should use `Map` for `aggregate`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org