Spark CSV Escape Not Working
<p>I am using spark-core version 2.0.1 with Scala 2.11. I have simple code to read a csv file which has \ escapes.</p>

<pre><code>val myDA = spark.read
      .option("quote",null)
    .schema(mySchema)
    .csv(filePath)
</code></pre>

<p>As per documentation \ is default escape for csv reader. But it does not work. Spark is reading \ as part of my data. For Ex: City column in csv file is <strong>north rocks\,au</strong> . I am expecting city column should read in code as <strong>northrocks,au</strong>. But instead spark reads it as <strong>northrocks\</strong> and moves <strong>au</strong> to next column.</p>

<p>I have tried following but did not work:</p>

<ul>
<li>Explicitly defined escape .option("escape","\")</li>
<li>Changed escape to | or : in file and in code</li>
<li>I have tried using spark-csv library</li>
</ul>

<p>Any one facing same issue? Am I missing something?</p>

<p>Thanks</p>