title: DROPMALFORMED not returning proper result in apache spark
body: <p>I need to load text file into Spark dataframe where I'm trying to skip header and footer using <code>DROPMALFORMED</code> mode, but its not being honored. </p>
  
  <p>Code:</p>
  
  <pre><code>val df1 = sparkSession.read.format("csv")
    .option("header", “true”) 
    .option("mode", "DROPMALFORMED") 
    .option("delimiter",";")
    .load(“/xxx/xxx/xxxx/test.txt")
    //df1.show(false)
  </code></pre>
  
  <p>File <code>test.txt</code> content:</p>
  
  <pre><code>04/11/2020
  
  name;age;id
  asdildsh;12;1
  ram;13;2
  oma;23;3
  radahea;14;4
  hellohow
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>+--------+----+---+
  |name    |age |id |
  +--------+----+---+
  |asdildsh| 12 | 1 |
  |ram     | 13 | 2 |
  |oma     | 23 | 3 |
  |radahea | 14 | 4 |
  +--------+----+---+ 
  </code></pre>