当前位置:   article > 正文

value toDF is not a member of org.apache.spark.rdd.RDD

maybe a semicolon is missing before `value todf'? ).todf("id", "text")‘’

idea显示toDF() 没有这个函数,显示错误:

  1. Error:(82, 8) value toDF is not a member of org.apache.spark.rdd.RDD[com.didichuxing.scala.BaseIndex]
  2. possible cause: maybe a semicolon is missing before `value toDF'?
  3. }).toDF()

解决:
增加一行:

import sqlContext.implicits._

http://ifeve.com/spark-sql-dataframes/

在spark1.3,从RDD到DataFrame的隐式转换隔离出来,单独放到SQLContext.implicits对象中,所以现在需要把RDD转换为Dataframe就需要引入这个

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/899635
推荐阅读
相关标签
  

闽ICP备14008679号