解决value toDF is not a member of org.apache.spark.rdd.RDD (spark2.1 )

解决上述办法有两点:

  1、两个import 需要放在 hiveCtx之后。

val hiveCtx: SparkSession = SparkSession.builder.config(conf).enableHiveSupport().getOrCreate()
import hiveCtx.sql
import hiveCtx.implicits._

  2、case class 类(param1:type1 )需要放在函数外面,作为成员变量。

 

 

posted @ 2018-11-29 14:52  白白毛狗  阅读(3301)  评论(0编辑  收藏  举报