LuciferYang commented on PR #37339:
URL: https://github.com/apache/spark/pull/37339#issuecomment-1199192546

   do the following change in Scala 2.13, the performance  of 
`Utils#getIteratorSize` method will be significantly improved, but this is for 
Scala 2.13:
   
   ```scala
   def getIteratorSize(iterator: Iterator[_]): Long = {
       if (iterator.knownSize > 0) {
         iterator.knownSize.toLong
       } else {
         var count = 0L
         while (iterator.hasNext) {
           count += 1L
           iterator.next()
         }
         count
       }
     }
   ```
   
   


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