Commit 292079f7 authored by 王志伟's avatar 王志伟

修改统计参数

parent 098f5ac3
......@@ -151,11 +151,8 @@ object coincidence_xinyang {
val sc = spark_env._2
val ti = new TiContext(sc)
ti.tidbMapTable(dbName = "jerry_prod", tableName = "diary_video")
ti.tidbMapTable(dbName = "jerry_prod", tableName = "data_feed_click")
ti.tidbMapTable(dbName = "jerry_prod", tableName = "blacklist")
ti.tidbMapTable(dbName = "jerry_test", tableName = "bl_device_list")
ti.tidbMapTable(dbName = "jerry_prod", tableName = "data_feed_exposure")
ti.tidbMapTable(dbName = "jerry_prod", tableName = "device_id_coincidence")
......@@ -204,7 +201,7 @@ object coincidence_xinyang {
|and cl_id not in (select device_id from bl_device_list)
|and cl_id not in (select device_id from blacklist)
""".stripMargin
)
).repartition(100)
all_device_id.createOrReplaceTempView("all_device_id")
......@@ -217,7 +214,7 @@ object coincidence_xinyang {
|from device_id_coincidence
|where stat_date = '${data}'
""".stripMargin
)
).repartition(100)
//2.获得应用列表的每日活跃总用户数
val yesterday_expoure_num = sc.sql(
s"""
......@@ -228,7 +225,7 @@ object coincidence_xinyang {
|and cl_id not in (select device_id from bl_device_list)
|and cl_id not in (select device_id from blacklist)
""".stripMargin
)
).repartition(100)
//获取每周活跃用户中与新氧重合用户占比
......@@ -240,7 +237,7 @@ object coincidence_xinyang {
|from device_id_coincidence
|where stat_date >= '${week_day}'
""".stripMargin
)
).repartition(100)
//2.获得应用列表的每周活跃总用户
val week_expoure_num = sc.sql(
s"""
......@@ -251,7 +248,7 @@ object coincidence_xinyang {
|and cl_id not in (select device_id from bl_device_list)
|and cl_id not in (select device_id from blacklist)
""".stripMargin
)
).repartition(100)
//获取每月活跃用户中与新氧用户重合用户占比
//1.0 每月活跃中与新氧用户重合用户数
......@@ -262,7 +259,7 @@ object coincidence_xinyang {
|from device_id_coincidence
|where stat_date > '${month_day}'
""".stripMargin
)
).repartition(100)
//2.0 获得应用列表的每月活跃总用户
val month_expoure_num = sc.sql(
s"""
......@@ -273,7 +270,7 @@ object coincidence_xinyang {
|and cl_id not in (select device_id from bl_device_list)
|and cl_id not in (select device_id from blacklist)
""".stripMargin
)
).repartition(100)
val result = yesterday_coincidence.join(yesterday_expoure_num,"stat_date")
.join(week_coincidence,"stat_date")
......@@ -294,7 +291,7 @@ object coincidence_xinyang {
|and pay_time >= '2017-11-18'
|and device_id in (select distinct(device_id) from device_id_coincidence)
""".stripMargin
)
).repartition(100)
meigou_coincidence_num.show()
......@@ -308,7 +305,7 @@ object coincidence_xinyang {
|and pay_time >= '2017-11-18'
|and device_id in (select distinct(device_id) from device_id_coincidence)
""".stripMargin
)
).repartition(100)
meigou_pay_device.show()
//3.获得应用列表的用户的美购数
val meigou_pay_all = sc.sql(
......@@ -320,7 +317,7 @@ object coincidence_xinyang {
|and pay_time is not null
|and pay_time >= '2017-11-18'
""".stripMargin
)
).repartition(100)
meigou_pay_all.show()
//4.获得应用列表用户进行美购的用户数
......@@ -333,7 +330,7 @@ object coincidence_xinyang {
|and pay_time is not null
|and pay_time >= '2017-11-18'
""".stripMargin
)
).repartition(100)
meigou_pay_device_all.show()
//截止目前获得的与新氧重合的用户数咨询统计
......@@ -345,7 +342,7 @@ object coincidence_xinyang {
|where partition_date >= '20180501'
|and action = 'welfare_detail_click_message'
""".stripMargin
)
).repartition(100)
zixun_num_all.show()
val zixun_device_all = sc.sql(
......@@ -356,7 +353,7 @@ object coincidence_xinyang {
|where partition_date >= '20180501'
|and action = 'welfare_detail_click_message'
""".stripMargin
)
).repartition(100)
zixun_device_all.show()
val zixun_num_co = sc.sql(
......@@ -367,7 +364,7 @@ object coincidence_xinyang {
|and action = 'welfare_detail_click_message'
|and cl_id in (select distinct(device_id) from device_id_coincidence)
""".stripMargin
)
).repartition(100)
zixun_num_co.show()
val zixun_num_co_dis = sc.sql(
......@@ -378,7 +375,7 @@ object coincidence_xinyang {
|and action = 'welfare_detail_click_message'
|and cl_id in (select distinct(device_id) from device_id_coincidence)
""".stripMargin
)
).repartition(100)
zixun_num_co_dis.show()
......
......@@ -222,15 +222,6 @@ object evaluation_indicator_ {
val spark_env = GmeiConfig.getSparkSession()
val sc = spark_env._2
val ti = new TiContext(sc)
ti.tidbMapTable(dbName = "jerry_prod", tableName = "diary_video")
ti.tidbMapTable(dbName = "jerry_prod", tableName = "data_feed_click")
ti.tidbMapTable(dbName = "jerry_prod", tableName = "blacklist")
ti.tidbMapTable(dbName = "jerry_test", tableName = "bl_device_list")
ti.tidbMapTable(dbName = "jerry_prod", tableName = "data_feed_exposure")
ti.tidbMapTable(dbName = "jerry_prod", tableName = "merge_queue_table")
import sc.implicits._
//val stat_date = GmeiConfig.getMinusNDate(1)
//println(param.date)
......
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