Commit fd9fb743 authored by 王志伟's avatar 王志伟

chang

parent 64db813f
...@@ -10,6 +10,8 @@ import org.apache.log4j.{Level, Logger} ...@@ -10,6 +10,8 @@ import org.apache.log4j.{Level, Logger}
import scopt.OptionParser import scopt.OptionParser
import com.gmei.lib.AbstractParams import com.gmei.lib.AbstractParams
import scala.util.parsing.json.JSON
object testt { object testt {
Logger.getLogger("org.apache.spark").setLevel(Level.WARN) Logger.getLogger("org.apache.spark").setLevel(Level.WARN)
...@@ -70,8 +72,13 @@ object testt { ...@@ -70,8 +72,13 @@ object testt {
|and partition_date = ${newtime} |and partition_date = ${newtime}
""".stripMargin """.stripMargin
) )
get_data_dura.show() val result = get_data_dura.rdd.map(row =>{
val rows = get_data_dura.collect() val rowAppFieldMap:Map[String,Any] = row.getAs[Map[String,Any]]("params")
if (rowAppFieldMap.contains("duration")){
val exposure_data_lists:List[Any] = JSON.parseFull(rowAppFieldMap("duration").toString).get.asInstanceOf[List[Any]]
println(exposure_data_lists)
}
})
// println(rows(1)) 这样会报错 // println(rows(1)) 这样会报错
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment