val bsInOut = spark.read.parquet(bsInOutPath).select("report_province", "imsi", "msisdn", "countryCode", "phone7", "countyId", "laccell", "procedureStartTime", "procedureEndTime", "longitude", "latitude").rdd
val personTrace = bsInOut.map(w => AreaInAndOutService.handleTraceInput(w))
def handleTraceInput(w: Row): PersonTrace = {
PersonTrace(ChangeTool.StringValues(w.get(0)), ChangeTool.StringValues(w.get(1)), ChangeTool.StringValues(w.get(2)), ChangeTool.StringValues(w.get(3))
, ChangeTool.StringValues(w.get(4)), ChangeTool.StringValues(w.get(5)), ChangeTool.StringValues(w.get(6)), w.get(7).toString.toLong, w.get(8).toString.toLong)
}
def StringValues(value: Any) = {
if (value != null) {
value.toString
}else{
""
}
}
case class PersonTrace(report_province: String, imsi: String, msisdn: String, countryCode: String, phone7: String, countyId: String, laccell: String, procedureStartTime: Long, procedureEndTime: Long)
将上面的代码改为非RDD的格式求大神给一个解决方法