Commit 61840c1f authored by 王志伟's avatar 王志伟

统计icon数据

parent 8f983d69
......@@ -1080,6 +1080,58 @@ object icon_data {
device_id.createTempView("device_id")
//总体点击
val icon_click_all = sc.sql(
s"""
|select count(*) as icon_click_num
|from online.tl_hdfs_maidian_view
|where partition_date='${partition_date}'
|and action='home_click_section'
""".stripMargin
)
icon_click_all.createOrReplaceTempView("icon_click_all")
icon_click_all.show()
//总体曝光
val icon_expoure_all = sc.sql(
s"""
|select count(*) as icon_expoure_num
|from online.ml_community_exposure_detail_new
|where partition_date='${partition_date}'
|and business_type='icon'
""".stripMargin
)
icon_expoure_all.createOrReplaceTempView("icon_expoure_all")
icon_expoure_all.show()
//指定用户的点击
val icon_click_device = sc.sql(
s"""
|select count(*) as icon_click_num_device
|from online.tl_hdfs_maidian_view a
|inner join device_id b
|on a.cl_id=b.device_id
|where a.partition_date='${partition_date}'
|and a.action='home_click_section'
""".stripMargin
)
icon_click_all.createOrReplaceTempView("icon_click_all")
icon_click_device.show()
//指定用户的曝光
val icon_expoure_device = sc.sql(
s"""
|select count(*) as icon_expoure_num_device
|from online.ml_community_exposure_detail_new a
|inner join device_id b
|on a.cl_id=b.device_id
|where a.partition_date='${partition_date}'
|and a.business_type='icon'
""".stripMargin
)
icon_expoure_all.createOrReplaceTempView("icon_expoure_all")
icon_expoure_device.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