Reading JSON with Apache Spark - `corrupt_record` : <p>I have a <code>json</code> file, <code>nodes</code> that looks like this:</p>

<pre><code>[{"toid":"osgb4000000031043205","point":[508180.748,195333.973],"index":1}
,{"toid":"osgb4000000031043206","point":[508163.122,195316.627],"index":2}
,{"toid":"osgb4000000031043207","point":[508172.075,195325.719],"index":3}
,{"toid":"osgb4000000031043208","point":[508513,196023],"index":4}]
</code></pre>

<p>I am able to read and manipulate this record with Python.</p>

<p>I am trying to read this file in <code>scala</code> through the <code>spark-shell</code>.</p>

<p>From this <a href="http://xinhstechblog.blogspot.be/2015/06/reading-json-data-in-spark-dataframes.html" rel="noreferrer">tutorial</a>, I can see that it is possible to read <code>json</code> via <code>sqlContext.read.json</code></p>

<pre><code>val vfile = sqlContext.read.json("path/to/file/nodes.json")
</code></pre>

<p>However, this results in a <code>corrupt_record</code> error:</p>

<pre><code>vfile: org.apache.spark.sql.DataFrame = [_corrupt_record: string]
</code></pre>

<p>Can anyone shed some light on this error? I can read and use the file with other applications and I am confident it is not corrupt and sound <code>json</code>.</p>
