Javatpoint Logo
Javatpoint Logo

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.
Spark Count Function
  • Apply count() function to count number of elements.
Spark Count Function

Here, we got the desired output.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA