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

smart_rank 相关的统计指标

parent 6e3e5b99
...@@ -602,7 +602,6 @@ object smart_rank_count { ...@@ -602,7 +602,6 @@ object smart_rank_count {
""".stripMargin """.stripMargin
) )
blacklist_id.createOrReplaceTempView("blacklist_id") blacklist_id.createOrReplaceTempView("blacklist_id")
blacklist_id.show()
val final_id = sc.sql( val final_id = sc.sql(
s""" s"""
...@@ -614,20 +613,20 @@ object smart_rank_count { ...@@ -614,20 +613,20 @@ object smart_rank_count {
""".stripMargin """.stripMargin
) )
final_id.createOrReplaceTempView("final_id") final_id.createOrReplaceTempView("final_id")
final_id.show()
val user_city_meigou_view = sc.sql( val user_city_meigou_view = sc.sql(
s""" s"""
|select cl_id as device_id,city_id as device_city,params['business_id'] as meigou_id |select ov.cl_id as device_id,ov.city_id as device_city,ov.params['business_id'] as meigou_id
|from online.tl_hdfs_maidian_view |from online.tl_hdfs_maidian_view ov left join final_id
|where action = "page_view" |on ov.cl_id = final_id.device_id
|and params['page_name']="welfare_detail" |where ov.action = "page_view"
|and partition_date >='20181201' |and ov.params['page_name']="welfare_detail"
|and city_id is not null |and ov.partition_date >='20181201'
|and ov.city_id is not null
|and final_id.device_id is null
""".stripMargin """.stripMargin
) )
user_city_meigou_view.show()
user_city_meigou_view.createOrReplaceTempView("user_city_meigou_view") user_city_meigou_view.createOrReplaceTempView("user_city_meigou_view")
val meigou_city = sc.sql( val meigou_city = sc.sql(
...@@ -702,17 +701,17 @@ object smart_rank_count { ...@@ -702,17 +701,17 @@ object smart_rank_count {
//开始计算每个地区每月新增设备 //开始计算每个地区每月新增设备
// val device_new_count = sc.sql( val device_new_count = sc.sql(
// s""" s"""
// |select first_city,count(distinct(device_id)) |select first_city,count(distinct(device_id))
// |from online.ml_device_day_active_status |from online.ml_device_day_active_status
// |where active_type != '4' |where active_type != '4'
// |and partition_date >='20181201' |and partition_date >='20181201'
// |group by first_city |group by first_city
// |order by first_city |order by first_city
// """.stripMargin """.stripMargin
// ) )
// device_new_count.show() device_new_count.show()
......
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