Commit 816cd8dd authored by 王志伟's avatar 王志伟

save to table(jerry_prod)

parent e7b38822
......@@ -54,9 +54,9 @@ object temp_analysis {
import sc.implicits._
// val stat_date = GmeiConfig.getMinusNDate(1)
val stat_date = GmeiConfig.getMinusNDate(1)
//println(param.date)
val partition_date = param.date.replace("-","")
val partition_date = stat_date.replace("-","")
//获取策略命中用户device_id
val device_id_cover = sc.sql(
......@@ -70,7 +70,7 @@ object temp_analysis {
val diary_pv = sc.sql(
s"""
|select '${param.date}' as stat_date,count(params["business_id"]) as diary_pv,count(distinct(cl_id)) as device_num_diary
|select '${stat_date}' as stat_date,count(params["business_id"]) as diary_pv,count(distinct(cl_id)) as device_num_diary
|from online.tl_hdfs_maidian_view
|where action="page_view"
|and params["page_name"]="diary_detail"
......@@ -81,7 +81,7 @@ object temp_analysis {
val meigou_pv = sc.sql(
s"""
|select '${param.date}' as stat_date,count(params["business_id"]) as meigou_pv,count(distinct(cl_id)) as device_num_meigou
|select '${stat_date}' as stat_date,count(params["business_id"]) as meigou_pv,count(distinct(cl_id)) as device_num_meigou
|from online.tl_hdfs_maidian_view
|where action="page_view"
|and params["page_name"]="welfare_detail"
......@@ -93,8 +93,9 @@ object temp_analysis {
val result = diary_pv.join(meigou_pv,"stat_date")
result.show()
GmeiConfig.writeToJDBCTable(result, "diary_pv", SaveMode.Append)
result.select("stat_date","diary_pv","device_num_diary","meigou_pv","device_num_meigou").write.mode(SaveMode.Append).save("/data2/test.txt")
// result.select("stat_date","diary_pv","device_num_diary","meigou_pv","device_num_meigou").write.mode(SaveMode.Append).save("/data2/test.txt")
......
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