title: apache Spark java : columnNameOfCorruptRecord and badRecordsPath not working while loading csv
body: <p>We are trying to perform bad data handling while loading spark. We are using spark 2.4.0. Currently, as of now <code>PERMISSIVE</code> , <code>FAILFAST</code> and <code>DROPMALFORMED</code> modes are working as expected. But i tried everything <code>columnNameOfCorruptRecord</code> and <code>badRecordsPath</code> option are not working.</p>
  <p>I am not sure if these options are even supported or not. Have gone thorugh documenation and googled a lot. But <code>columnNameOfCorruptRecord</code> and <code>badRecordsPath</code> are not working
  This is how i used it</p>
  <pre><code>spark.read
                .option(&quot;badRecordsPath&quot;, &quot;/tmp/badRecordsPath&quot;)
                .schema(&quot;Country String, Rank Integer&quot;)
                .csv(&quot;/tmp/inputFile.csv&quot;)
  </code></pre>
  <p>or</p>
  <pre><code>spark.read
                .option(&quot;columnNameOfCorruptRecord&quot;, &quot;corrupted&quot;)
                .schema(&quot;Country String, Rank Integer&quot;)
                .csv(&quot;/tmp/inputFile.csv&quot;)
  </code></pre>
  <p>Can anyone please help me, have been struggling a bit</p>