val lookup = Map("_1" -> "id","_2" -> "type","_3" -> "cookie_id") val rlog = spark.read.textFile(path) val rlog1 = rlog.map(_.split("#")).map(x=>(getSceneId(x(15)) ,x(21),x(3) )) val rlog2 = rlog1.select(rlog1.columns.map(c => col(c).as(lookup.getOrElse(c, c))): _*)
错误1
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._ 可能是少了隐式转换