title: Dataframe from List<String> in Java
body: <ul>
  <li>Spark Version : 1.6.2</li>
  <li>Java Version: 7</li>
  </ul>
  
  <p>I have a <code>List&lt;String&gt;</code> data. Something like: </p>
  
  <pre><code>[[dev, engg, 10000], [karthik, engg, 20000]..]
  </code></pre>
  
  <p>I know schema for this data.</p>
  
  <pre><code>name (String)
  degree (String)
  salary (Integer)
  </code></pre>
  
  <hr>
  
  <p>I tried:</p>
  
  <pre><code>JavaRDD&lt;String&gt; data = new JavaSparkContext(sc).parallelize(datas);
  DataFrame df = sqlContext.read().json(data);
  df.printSchema();
  df.show(false);
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>root
   |-- _corrupt_record: string (nullable = true)
  
  
  +-----------------------------+
  |_corrupt_record              |
  +-----------------------------+
  |[dev, engg, 10000]           |
  |[karthik, engg, 20000]       |
  +-----------------------------+
  </code></pre>
  
  <p>Because <code>List&lt;String&gt;</code> is not a proper JSON.</p>
  
  <p><strong>Do I need to create a proper JSON or is there any other way to do this?</strong></p>