title: value toDF is not a member of org.apache.spark.rdd.RDD
body: <p>I've read about this issue in other SO posts and I still don't know what I'm doing wrong. In principle, adding these two lines:</p>
  
  <pre><code>val sqlContext = new org.apache.spark.sql.SQLContext(sc)
  import sqlContext.implicits._
  </code></pre>
  
  <p>should have done the trick but the error persists</p>
  
  <p>This my build.sbt:</p>
  
  <pre><code>name := "PickACustomer"
  
  version := "1.0"
  
  scalaVersion := "2.11.7"
  
  
  libraryDependencies ++= Seq("com.databricks" %% "spark-avro" % "2.0.1",
  "org.apache.spark" %% "spark-sql" % "1.6.0",
  "org.apache.spark" %% "spark-core" % "1.6.0")
  </code></pre>
  
  <p>and my scala code is:</p>
  
  <pre><code>import scala.collection.mutable.Map
  import scala.collection.immutable.Vector
  
  import org.apache.spark.rdd.RDD
  import org.apache.spark.SparkContext
  import org.apache.spark.SparkContext._
  import org.apache.spark.SparkConf
  import org.apache.spark.sql._
  
  
      object Foo{
  
      def reshuffle_rdd(rawText: RDD[String]): RDD[Map[String, (Vector[(Double, Double, String)], Map[String, Double])]]  = {...}
  
      def do_prediction(shuffled:RDD[Map[String, (Vector[(Double, Double, String)], Map[String, Double])]], prediction:(Vector[(Double, Double, String)] =&gt; Map[String, Double]) ) : RDD[Map[String, Double]] = {...}
  
      def get_match_rate_from_results(results : RDD[Map[String, Double]]) : Map[String, Double]  = {...}
  
  
      def retrieve_duid(element: Map[String,(Vector[(Double, Double, String)], Map[String,Double])]): Double = {...}
  
  
  
  
      def main(args: Array[String]){
          val conf = new SparkConf().setAppName(this.getClass.getSimpleName)
          if (!conf.getOption("spark.master").isDefined) conf.setMaster("local")
  
          val sc = new SparkContext(conf)
  
          //This should do the trick
          val sqlContext = new org.apache.spark.sql.SQLContext(sc)
          import sqlContext.implicits._
  
          val PATH_FILE = "/mnt/fast_export_file_clean.csv"
          val rawText = sc.textFile(PATH_FILE)
          val shuffled = reshuffle_rdd(rawText)
  
          // PREDICT AS A FUNCTION OF THE LAST SEEN UID
          val results = do_prediction(shuffled.filter(x =&gt; retrieve_duid(x) &gt; 1) , predict_as_last_uid)
          results.cache()
  
          case class Summary(ismatch: Double, t_to_last:Double, nflips:Double,d_uid: Double, truth:Double, guess:Double)
  
          val summary = results.map(x =&gt; Summary(x("match"), x("t_to_last"), x("nflips"), x("d_uid"), x("truth"), x("guess")))
  
  
          //PROBLEMATIC LINE
          val sum_df = summary.toDF()
  
      }
      }
  </code></pre>
  
  <p>I always get:</p>
  
  <blockquote>
    <p>value toDF is not a member of org.apache.spark.rdd.RDD[Summary]</p>
  </blockquote>
  
  <p>Bit lost now. Any ideas?</p>