Spark:【error】DataFrames转DataSet失败

Error:(45, 63) Unable to find encoder for type stored in a Dataset.  Primitive types (Int, String, etc) and Product types (case classes) are supported by importing spark.implicits._  Support for serializing other types will be added in future releases.
    val ds = spark.read.json("F:\\BigData\\employees.json").as[Employee]

 

解决方法:

创建 SparkSession后引入语句:

  import spark.implicits._

 

posted @ 2019-06-20 17:01  drl_blogs  阅读(232)  评论(0编辑  收藏  举报