title: Spark 2.4 CSV Load Issue with option "nullvalue"
body: <p>We were using Spark 2.3 before, now we're on 2.4:</p>
  
  <pre><code>Spark version 2.4.0
  Using Scala version 2.11.12 (OpenJDK 64-Bit Server VM, Java 1.8.0_212)
  </code></pre>
  
  <p>We had a piece of code running in production that converted csv files to parquet format.
  One of the options we had set csv load is option("nullValue", null). There's something wrong with how it works in spark 2.4.</p>
  
  <p>Here's an example to show the issue.</p>
  
  <ol>
  <li>let's create the following /tmp/test.csv file:</li>
  </ol>
  
  <pre><code>C0,C1,C2,C3,C4,C5
  1,"1234",0.00,"","D",0.00
  2,"",0.00,"","D",0.00
  
  </code></pre>
  
  <ol start="2">
  <li>Now if we load it in spark-shell</li>
  </ol>
  
  <pre><code>scala&gt; val data1 = spark.read.option("header", "true").option("inferSchema", "true").option("treatEmptyValuesAsNulls","true").option("nullValue", null).csv("file:///tmp/test.csv")
  
  we get an empty row:
  scala&gt; data1.show
  +----+----+----+----+----+----+
  | C0| C1| C2| C3| C4| C5|
  +----+----+----+----+----+----+
  | 1|1234| 0.0| | D| 0.0|
  |null|null|null|null|null|null|
  +----+----+----+----+----+----+
  
  </code></pre>
  
  <ol start="3">
  <li>If we additionally change the csv a little (replaced empty string with "1" in the last row)</li>
  </ol>
  
  <pre><code>C0,C1,C2,C3,C4,C5
  1,"1234",0.00,"","D",0.00
  2,"",0.00,"1","D",0.00
  </code></pre>
  
  <p>the result is even worse:</p>
  
  <pre><code>scala&gt; val data2 = spark.read.option("header", "true").option("inferSchema", "true").option("treatEmptyValuesAsNulls","true").option("nullValue", null).csv("file:///tmp/test.csv")
  
  scala&gt; data2.show
  +----+----+----+----+----+----+
  | C0| C1| C2| C3| C4| C5|
  +----+----+----+----+----+----+
  |null|null|null|null|null|null|
  |null|null|null|null|null|null|
  +----+----+----+----+----+----+
  
  </code></pre>
  
  <p>Is this a bug in new version of spark 2.4.0 ? Any body faced similar issue ? </p>