cloud-fan commented on code in PR #43448:
URL: https://github.com/apache/spark/pull/43448#discussion_r1411844730


##########
common/sketch/src/test/scala/org/apache/spark/util/sketch/CountMinSketchSuite.scala:
##########
@@ -56,7 +56,7 @@ class CountMinSketchSuite extends AnyFunSuite { // 
scalastyle:ignore funsuite
 
       val exactFreq = {
         val sampledItems = sampledItemIndices.map(allItems)
-        sampledItems.groupBy(identity).mapValues(_.length.toLong)
+        sampledItems.groupBy(identity).view.mapValues(_.length.toLong)

Review Comment:
   As an early Spark contributor, I can bet that when most people write 
`.mapValue`, they never consider this lazy thing but just treat it the same as 
`Seq.map`.
   
   For example, this is a test, who cares if the map is lazy or not?
   
   @LuciferYang can you help to go through all the changes in this PR, and 
identify the places that do need a lazy map?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to