title: Reading Json file using Apache Spark
body: <p>I am trying to read Json file using Spark v2.0.0. In case of simple data code works really well. In case of little bit complex data, when i print df.show() the data is not showing in correct way.</p>
  
  <p>here is my code:</p>
  
  <pre><code>SparkSession session = SparkSession.builder().master("local").appName("jsonreader").getOrCreate();
  Dataset&lt;Row&gt; list = session.read().json("/Users/hadoop/Desktop/sample.json");
  list.show();
  </code></pre>
  
  <p>Here is my sample data:</p>
  
  <pre><code>{
      "glossary": {
          "title": "example glossary",
          "GlossDiv": {
              "title": "S",
              "GlossList": {
                  "GlossEntry": {
                      "ID": "SGML",
                      "SortAs": "SGML",
                      "GlossTerm": "Standard Generalized Markup Language",
                      "Acronym": "SGML",
                      "Abbrev": "ISO 8879:1986",
                      "GlossDef": {
                          "para": "A meta-markup language, used to create markup languages such as DocBook.",
                          "GlossSeeAlso": ["GML", "XML"]
                      },
                      "GlossSee": "markup"
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>And my output is like:</p>
  
  <pre><code>+--------------------+
  |     _corrupt_record|
  +--------------------+
  |                   {|
  |       "glossary": {|
  |        "title": ...|
  |           "GlossDiv": {|
  |            "titl...|
  |               "GlossList": {|
  |                "...|
  |                 ...|
  |                   "SortAs": "S...|
  |                   "GlossTerm":...|
  |                   "Acronym": "...|
  |                   "Abbrev": "I...|
  |                   "GlossDef": {|
  |                 ...|
  |                       "GlossSeeAl...|
  |                 ...|
  |                   "GlossSee": ...|
  |                   }|
  |                   }|
  |                   }|
  +--------------------+
  only showing top 20 rows
  </code></pre>