title: Spark DataFrame handling corrupted record
body: <p>In spark dataFrame, how to handle corrupted record?. Actually, I am looking for the corrupted record should persist to another file for later review. Mode - <code>DROPMALFORMED</code> option will drop corrupted record from the dataset. it will help.</p>
  
  <pre><code>val data = sparkSession.read
                         .option("mode", "DROPMALFORMED")
                         .json("file:///C:/finances.json")
  </code></pre>