title: Difference between Spark application vs job vs stage vs task?
body: <p>As per my understanding:</p>
  
  <pre><code>1. Spark application is a whole piece of code (jar) 
  2. Spark job is subset of code - for each action one job will be created
  3. Spark stage is subset of job - whenever data shuffle happens (wide transformation) - one stage will be created 
  4. Spark task is the actual task which runs our code - for each partition - one task will be created
  </code></pre>
  
  <p>Now, i have one rdd with numbers. I want to filter even and odd numbers from the given rdd and save as even and odd text file respectively .</p>
  
  <p>As per the above description , there should be 2 jobs created . But there is only one job created.</p>
  
  <p>Can anyone please clarify the logic how spark job/stage/task are being created.</p>