balajij8
Esteemed Contributor II
  • Worker nodes (Executors) - Each executor computes a partial count of records within its partitions locally.
  • Driver node - All partial counts aresent to the driver, which performs the final summation and returns the result. Count is an action. Spark keeps the aggregation distributed until the final work is done.

View solution in original post