title: Spark Scala read text file into DataFrame
body: <p>I wish to read a file and store it into a DataFrame.
  I am reading a text file a storing into an RDD[Array[String]].</p>
  
  <pre><code>val file = sc.textFile("/mockSmall.txt").map(line =&gt; line.split(",").map(_.trim))
  case class record(eventName: String, date: String, counter: String)
  val solrDF: DataFrame = file.map{case Array(s0, s1, s2) =&gt; record(s0, s1, s2)}.toDF()
  </code></pre>
  
  <p>However, I get the following compilation issue:</p>
  
  <p>value DF is not a member of RDD[record]</p>
  
  <p>How can I solve this?
  Note: I am using spark 1.6, thus I do not have sparkSession. </p>