object test {
def main(args: Array[String]): Unit = {
val df = tdw.table("video",Seq("hello")).map(record=>{
val kv = deal_json(record(3).toString)
kv
})
df.first()
sparkBuilder.stop()
}
def deal_json(data:String): JSONArray ={
val jsonData=JSON.parseObject(data)
val kv = jsonData.getJSONArray("feature")
kv
}
}
出现此错误:
错误:(20,71)参数映射的参数不足:(隐式证据$ 6:org.apache.spark.sql.Encoder [com.alibaba.fastjson.JSONArray])org.apache.spark.sql.Dataset [com.alibaba.fastjson.JSONArray]。 未指定值参数证据$ 6。 val df = tdw.table(“ video_t_boss_v1_6564”,Seq(“ p_2018082309”))。map(record => {