idea显示toDF() 没有这个函数,显示错误:
- Error:(82, 8) value toDF is not a member of org.apache.spark.rdd.RDD[com.didichuxing.scala.BaseIndex]
- possible cause: maybe a semicolon is missing before `value toDF'?
- }).toDF()
解决:
增加一行:
import sqlContext.implicits._
http://ifeve.com/spark-sql-dataframes/
在spark1.3,从RDD到DataFrame的隐式转换隔离出来,单独放到SQLContext.implicits对象中,所以现在需要把RDD转换为Dataframe就需要引入这个