title: Reading pretty print json files in Apache Spark
body: <p>I have a lot of json files in my S3 bucket and I want to be able to read them and query those files. The problem is they are pretty printed. One json file has just one massive dictionary but it's not in one line. As per <a href="https://stackoverflow.com/questions/35409539/corrupt-record-error-when-reading-a-json-file-into-spark">this</a> thread, a dictionary in the json file should be in one line which is a limitation of Apache Spark. I don't have it structured that way.</p>
  
  <p>My JSON schema looks like this - </p>
  
  <pre><code>{
      "dataset": [
          {
              "key1": [
                  {
                      "range": "range1", 
                      "value": 0.0
                  }, 
                  {
                      "range": "range2", 
                      "value": 0.23
                  }
               ]
          }, {..}, {..}
      ],
      "last_refreshed_time": "2016/09/08 15:05:31"
  }
  </code></pre>
  
  <p>Here are my questions - </p>
  
  <ol>
  <li><p>Can I avoid converting these files to match the schema required by Apache Spark (one dictionary per line in a file) and still be able to read it?</p></li>
  <li><p>If not, what's the best way to do it in Python? I have a bunch of these files for each day in the bucket. The bucket is partitioned by day. </p></li>
  <li><p>Is there any other tool better suited to query these files other than Apache Spark? I'm on AWS stack so can try out any other suggested tool with Zeppelin notebook.</p></li>
  </ol>