counts the number of elements in RDD code example Example: Return the number of elements in this RDD. sc.parallelize([2, 3, 4]).count() # 3