Commit 59ed61b9 authored by 王志伟's avatar 王志伟

smart_rank 相关的统计指标

parent b05d3de5
......@@ -663,26 +663,37 @@ object smart_rank_count {
//开始计算咨询
// val zixun_meigou_view = sc.sql(
// s"""
// |select cl_id as device_id,city_id as device_city,params['service_id'] as meigou_id
// |from online.tl_hdfs_maidian_view
// |where partition_date >= '20181201'
// |and action = 'welfare_detail_click_message'
// """.stripMargin
// )
// zixun_meigou_view.show(80)
// zixun_meigou_view.createOrReplaceTempView("zixun_meigou_view")
val zixun_meigou_view = sc.sql(
s"""
|select cl_id as device_id,city_id as device_city,params['service_id'] as meigou_id
|from online.tl_hdfs_maidian_view
|where partition_date >= '20181201'
|and action = 'welfare_detail_click_message'
""".stripMargin
)
zixun_meigou_view.createOrReplaceTempView("zixun_meigou_view")
// val zixun_meigou_tongcheng = sc.sql(
// s"""
// |select a.device_id,a.device_city,a.meigou_id,b.meigou_city
// |from zixun_meigou_view a
// |left join meigou_city b
// |on a.meigou_id=b.meigou_id
// """.stripMargin
// )
// zixun_meigou_tongcheng.show(80)
val zixun_meigou_tongcheng = sc.sql(
s"""
|select a.device_id,a.device_city,a.meigou_id,b.meigou_city
|from zixun_meigou_view a
|left join meigou_city b
|on a.meigou_id=b.meigou_id
""".stripMargin
)
zixun_meigou_tongcheng.createOrReplaceTempView("zixun_meigou_tongcheng")
val zixun_pv_count = sc.sql(
s"""
|select meigou_city,count(device_id) as meigou_pv,count(distinct(device_id)) as meigou_device_num
|from zixun_meigou_tongcheng
|where device_city=meigou_city
|group by meigou_city
""".stripMargin
)
meigou_pv_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