Converting JavaRDD to DataFrame in Spark java
<p>I am trying to process the LogFile. first i read the log file and split these file as per my requirement and saved each column into separate JavaRDD. Now i need to convert these JavaRDD's to DataFrames for future operations. This is the code what i tried so far:</p>

<pre><code>         SparkConf conf = new SparkConf().setAppName("AuctionBid").setMaster("local");
         JavaSparkContext sc = new JavaSparkContext(conf);
         JavaRDD&lt;String&gt; diskfile = sc.textFile("/Users/karuturi/Downloads/log.txt");
         JavaRDD&lt;String&gt; urlrdd=diskfile.flatMap(line -&gt; Arrays.asList(line.split("\t")[0]));
         System.out.println(urlrdd.take(1));
         SQLContext sql = new SQLContext(sc);
</code></pre>

<p>and this is the way how i am trying to convert JavaRDD into DataFrame:</p>

<pre><code>DataFrame fileDF = sqlContext.createDataFrame(urlRDD, Model.class);
</code></pre>

<p>But the above line is not working.I confusing about Model.class.</p>

<p>can anyone suggest me.</p>

<p>Thanks. </p>