Don't use count() when you don't need to return the exact number of rows
When you don't need to return the exact number of rows use:
instead of:
In RDD you can use isEmpty() because if you see the code: https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/rdd/RDD.scala
Last updated