Commit 38f10f6d authored by 王志伟's avatar 王志伟

chang

parent fd9fb743
...@@ -65,17 +65,21 @@ object testt { ...@@ -65,17 +65,21 @@ object testt {
println(newtime) println(newtime)
val get_data_dura = sc.sql( val get_data_dura = sc.sql(
s""" s"""
|select partition_date,params |select cl_id,params
|from online.tl_hdfs_maidian_view |from online.tl_hdfs_maidian_view
|where action="on_app_session_over" |where action="on_app_session_over"
|and cl_id regexp'${strategy}' |and cl_id regexp'${strategy}'
|and partition_date = ${newtime} |and partition_date = ${newtime}
""".stripMargin """.stripMargin
) )
val test = get_data_dura.take(10)
for (i <- 0 to 9) {
println(test(i))
}
val result = get_data_dura.rdd.map(row =>{ val result = get_data_dura.rdd.map(row =>{
val rowAppFieldMap:Map[String,Any] = row.getAs[Map[String,Any]]("params") val rowAppFieldMap:Map[String,Any] = row.getAs[Map[String,Any]]("params")
if (rowAppFieldMap.contains("duration")){ if (rowAppFieldMap.contains("duration")){
val exposure_data_lists:List[Any] = JSON.parseFull(rowAppFieldMap("duration").toString).get.asInstanceOf[List[Any]] val exposure_data_lists:List[Any] = JSON.parseFull(rowAppFieldMap)
println(exposure_data_lists) println(exposure_data_lists)
} }
}) })
......
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