Commit 73827f33 authored by litaolemo's avatar litaolemo

update

parent a015ed4a
...@@ -99,7 +99,7 @@ for t in range(0, task_days): ...@@ -99,7 +99,7 @@ for t in range(0, task_days):
,NVL(t3.search_uv,0) as uv ,NVL(t3.search_uv,0) as uv
FROM FROM
( (
SELECT t.active_type,t.device_os_type,t.channel,t.search_pv,t.search_uv FROM SELECT active_type,device_os_type,channel,search_pv,search_uv FROM
( (
SELECT active_type,device_os_type,channel SELECT active_type,device_os_type,channel
,count(t1.cl_id) as search_pv ,count(t1.cl_id) as search_pv
...@@ -108,15 +108,15 @@ for t in range(0, task_days): ...@@ -108,15 +108,15 @@ for t in range(0, task_days):
( (
SELECT partition_date,cl_id SELECT partition_date,cl_id
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
WHERE partition_date >= {yesterday_str} WHERE partition_date >= '{yesterday_str}'
AND partition_date < {today_str} AND partition_date < '{today_str}'
AND action in ('do_search','search_result_click_search') AND action in ('do_search','search_result_click_search')
UNION ALL UNION ALL
SELECT cl_id SELECT cl_id
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
WHERE partition_date >= {yesterday_str} WHERE partition_date >= '{yesterday_str}'
AND partition_date < {today_str} AND partition_date < '{today_str}'
AND action = 'on_click_card' AND action = 'on_click_card'
AND params['page_name']='search_home' AND params['page_name']='search_home'
...@@ -124,8 +124,8 @@ for t in range(0, task_days): ...@@ -124,8 +124,8 @@ for t in range(0, task_days):
SELECT partition_date SELECT partition_date
,cl_id ,cl_id
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
WHERE partition_date >= {yesterday_str} WHERE partition_date >= '{yesterday_str}'
AND partition_date < {today_str} AND partition_date < '{today_str}'
AND action = 'on_click_card' AND action = 'on_click_card'
AND params['in_page_pos']='猜你喜欢' AND params['in_page_pos']='猜你喜欢'
AND params['tab_name']='精选' AND params['tab_name']='精选'
...@@ -136,8 +136,8 @@ for t in range(0, task_days): ...@@ -136,8 +136,8 @@ for t in range(0, task_days):
SELECT partition_date SELECT partition_date
,cl_id ,cl_id
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
WHERE partition_date >= {yesterday_str} WHERE partition_date >= '{yesterday_str}'
AND partition_date < {today_str} AND partition_date < '{today_str}'
AND action = 'on_click_card' AND action = 'on_click_card'
AND page_name='welfare_home' AND page_name='welfare_home'
AND params['card_type'] ='search_word' AND params['card_type'] ='search_word'
...@@ -147,8 +147,8 @@ for t in range(0, task_days): ...@@ -147,8 +147,8 @@ for t in range(0, task_days):
SELECT partition_date SELECT partition_date
,cl_id ,cl_id
FROM online.bl_hdfs_maidian_updates FROM online.bl_hdfs_maidian_updates
WHERE partition_date >= {yesterday_str} WHERE partition_date >= '{yesterday_str}'
AND partition_date < {today_str} AND partition_date < '{today_str}'
AND int(split(app_version,'\\.')[1]) >= 27 AND int(split(app_version,'\\.')[1]) >= 27
AND action='on_click_card' AND action='on_click_card'
AND params['card_type']='highlight_word' AND params['card_type']='highlight_word'
...@@ -168,11 +168,11 @@ for t in range(0, task_days): ...@@ -168,11 +168,11 @@ for t in range(0, task_days):
LEFT JOIN LEFT JOIN
(SELECT code,is_ai_channel,partition_day (SELECT code,is_ai_channel,partition_day
FROM DIM.DIM_AI_CHANNEL_ZP_NEW FROM DIM.DIM_AI_CHANNEL_ZP_NEW
WHERE partition_day>= {yesterday_str} WHERE partition_day>= '{yesterday_str}'
AND partition_day < {today_str}) tmp AND partition_day < '{today_str}') tmp
ON m.partition_date=tmp.partition_day AND first_channel_source_type=code ON m.partition_date=tmp.partition_day AND first_channel_source_type=code
WHERE partition_date >= {yesterday_str} WHERE partition_date >= '{yesterday_str}'
AND partition_date < {today_str} AND partition_date < '{today_str}'
AND active_type in ('1','2','4') AND active_type in ('1','2','4')
) mas ) mas
LATERAL VIEW explode(mas.channel) t2 AS channel LATERAL VIEW explode(mas.channel) t2 AS channel
......
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