Well, terminology can always be difficult since it depends on context. In many cases, you can be used to "submit a job to a cluster", which for spark would be to submit a driver program.
That said, Spark has his own definition for "job", directly from the glossary:
Job A parallel computation consisting of multiple tasks that gets
spawned in response to a Spark action (e.g. save, collect); you'll see
this term used in the driver's logs.
So I this context, let's say you need to do the following:
- Load a file with people names and addresses into RDD1
- Load a file with people names and phones into RDD2
- Join RDD1 and RDD2 by name, to get RDD3
- Map on RDD3 to get a nice HTML presentation card for each person as RDD4
- Save RDD4 to file.
- Map RDD1 to extract zipcodes from the addresses to get RDD5
- Aggregate on RDD5 to get a count of how many people live on each zipcode as RDD6
- Collect RDD6 and prints these stats to the stdout.
So,
- The driver program is this entire piece of code, running all 8 steps.
- Producing the entire HTML card set on step 5 is a job (clear because we are using the save action, not a transformation). Same with the collect on step 8
- Other steps will be organized into stages, with each job being the result of a sequence of stages. For simple things a job can have a single stage, but the need to repartition data (for instance, the join on step 3) or anything that breaks the locality of the data usually causes more stages to appear. You can think of stages as computations that produce intermediate results, which can in fact be persisted. For instance, we can persist RDD1 since we'll be using it more than once, avoiding recomputation.
- All 3 above basically talk about how the logic of a given algorithm will be broken. In contrast, a task is a particular piece of data that will go through a given stage, on a given executor.
Hope it makes things clearer ;-)