title: Why spark.read.parquet() runs 2 jobs?
body: <p>I have a parquet file, named <code>test.parquet</code>. It contains some integers. When I read it using following code:</p>
  
  <pre><code>val df = spark.read.parquet("test.parquet")
  
  df.show(false)
  
  +---+
  |id |
  +---+
  |11 |
  |12 |
  |13 |
  |14 |
  |15 |
  |16 |
  |17 |
  |18 |
  |19 |
  +---+
  </code></pre>
  
  <p>In logs it shows 2 jobs that were executed. They are as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/BYosu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BYosu.png" alt="enter image description here"></a></p>
  
  <p>One is <code>parquet</code> job and another one is <code>show</code> job. Whereas, when I read parquet file using following code:</p>
  
  <pre><code>val df = spark.read.schema(StructType(List(StructField("id",LongType,false)))).parquet("test.parquet")
  
  df.show(false)
  
  +---+
  |id |
  +---+
  |11 |
  |12 |
  |13 |
  |14 |
  |15 |
  |16 |
  |17 |
  |18 |
  |19 |
  +---+
  </code></pre>
  
  <p>Only one job is executed, i.e., <code>show</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/e6VRy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/e6VRy.png" alt="enter image description here"></a></p>
  
  <p>So, my question is:</p>
  
  <ol>
  <li>Why first approach executes 2 jobs whereas second approach executes only one ?</li>
  <li>And, why second approach is faster than the first one ?</li>
  </ol>