The main function is the application.
When you invoke an action on an RDD, a "job" is created. Work is a work submitted by Spark.
The works are divided into "stages" based on the shuffle border. This will help you understand.
Each step is further divided into tasks based on the number of sections in the RDD. Thus, tasks are the smallest units of work for Spark.
source share