Spark 2.0 Scala - RDD.toDF()
Yes, you should import sqlContext implicits like that:
val sqlContext = //create sqlContext
import sqlContext.implicits._
val df = RDD.toDF()
Before you call to "toDF" in your RDDs
It's coming from here:
Spark 2 API
Explanation: if you import sqlContext.implicits._
, you have a implicit method to convert RDD
to DataSetHolder
(rddToDataSetHolder
), then you call toDF
on the DataSetHolder