115
Spark Count Function
In Spark, the Count function returns the number of elements present in the dataset.
Example of Count function
In this example, we count the number of elements exist in the dataset.
- Create an RDD using parallelized collection.
- Now, we can read the generated result by using the following command.
- Apply count() function to count number of elements.
Here, we got the desired output.
Next TopicSpark Distinct Function