action count() in Spark RDD
-
-
Explain the action count() in Spark RDD.
-
<div class=”post”>
<li style=”list-style-type: none”>
Example:
val rdd1 = sc.parallelize(List(10,20,30,40))
println(rdd1.count())
Output:
4
It returns a number of elements or items in RDD. So it basically counts the number of items present in the dataset and returns a number after the count.
</div>
- You must be logged in to reply to this topic.