Commit f9058dcb authored by 高雅喆's avatar 高雅喆

add device_search_tag

parent ed7c6985
......@@ -548,7 +548,7 @@ object GetDevicePortrait {
val device_search_tag = sc.sql(
s"""
|select c.device_id,c.stat_date,c.cid_id,count(c.level1_id) as level1_count
|select c.device_id,c.stat_date,c.level1_id,count(c.level1_id) as level1_count
|from (select
| a.cl_id as device_id,a.partition_date as stat_date,
| COALESCE(a.params['diary_id'], a.params['business_id'], 0) as cid_id,
......@@ -559,7 +559,7 @@ object GetDevicePortrait {
| where
| a.partition_date = '20181224'
| and (a.action = 'on_click_diary_card' or (a.action="full_stack_click_video_card_full_screen_play" and a.params["card_type"]="diary"))) c
|group by c.device_id,c.cid_id,c.stat_date
|group by c.device_id,c.level1_id,c.stat_date
""".stripMargin
)
device_search_tag.show()
......@@ -569,7 +569,7 @@ object GetDevicePortrait {
val max_count_tag = sc.sql(
s"""
|select a.device_id,a.stat_date,a.cid_id,a.level1_count
|select a.device_id,a.stat_date,a.level1_id,a.level1_count
|from tag_count a
|inner join
|(select device_id,max(level1_count) as max_count from tag_count group by device_id) b
......
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