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

smart_rank 相关的统计指标

parent 90482418
......@@ -648,7 +648,7 @@ object smart_rank_count {
|select a.device_id,a.device_city,a.meigou_id,b.meigou_city
|from user_city_meigou_view a
|left join meigou_city b
|on a.meigou_id=b.meigou_id
|on a.meigou_id = b.meigou_id
""".stripMargin
)
meigou_pv_tongcheng.createOrReplaceTempView("meigou_pv_tongcheng")
......@@ -657,7 +657,7 @@ object smart_rank_count {
s"""
|select meigou_city,count(device_id) as meigou_pv,count(distinct(device_id)) as meigou_device_num
|from meigou_pv_tongcheng
|where device_city=meigou_city
|where device_city = meigou_city
|group by meigou_city
""".stripMargin
)
......@@ -701,17 +701,17 @@ object smart_rank_count {
//开始计算每个地区每月新增设备
val device_new_count = sc.sql(
s"""
|select first_city,count(distinct(device_id))
|from online.ml_device_day_active_status
|where active_type != '4'
|and partition_date >='20181201'
|group by first_city
|order by first_city
""".stripMargin
)
device_new_count.show()
// val device_new_count = sc.sql(
// s"""
// |select first_city,count(distinct(device_id))
// |from online.ml_device_day_active_status
// |where active_type != '4'
// |and partition_date >='20181201'
// |group by first_city
// |order by first_city
// """.stripMargin
// )
// 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