Commit e4c41957 authored by 魏艺敏's avatar 魏艺敏

update codes

parent 46aa1f9d
#step4.job
type=command
dependencies=step3
command=curl -X GET http://localhost:8553/api/report/sendEmail/weiyimin@igengmei.com/zhaojianwei@igengmei.com/daily_recommend_strategy
\ No newline at end of file
command=curl -X GET http://localhost:8553/api/report/sendEmail/liudi@igengmei.com,wangxin@igengmei.com,liweirui@igengmei.com,duanyingrong@igengmei.com,xuepengfei@igengmei.com,dengguangyu@igengmei.com/zhaofei@igengmei.com,weiyimin@igengmei.com,zhaojianwei@igengmei.com/daily_recommend_strategy
\ No newline at end of file
#step1_2.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online bl_hdfs_maidian_updates
\ No newline at end of file
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_device_history_detail
\ No newline at end of file
#step1_3.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online bl_hdfs_maidian_updates
\ No newline at end of file
#step1_4.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive ml ml_d_ct_dv_devicespam_d
\ No newline at end of file
#step1_5.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_community_precise_exposure_detail
\ No newline at end of file
#step2.job
type=command
dependencies=step1_1,step1_2
command=curl -X GET http://localhost:8553/api/report/execSql?name=search_related_insert
\ No newline at end of file
dependencies=step1_1,step1_2,step1_3,step1_4,step1_5
command=/home/bi/bi-report/shells/search_related/search_related.sh
\ No newline at end of file
#step3.job
#step3-1.job
type=command
dependencies=step2
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_search_click_path_d
\ No newline at end of file
#step3-2.job
type=command
dependencies=step2
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_search_input_type_d
\ No newline at end of file
#step3-3.job
type=command
dependencies=step2
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_search_result_click_rate_d
\ No newline at end of file
#step4.job
type=command
dependencies=step3
command=curl -X GET http://localhost:8553/api/report/sendEmail/weiyimin@igengmei.com/search_related
\ No newline at end of file
dependencies=step3_1,step3_2,step3_3
command=curl -X GET http://localhost:8553/api/report/sendEmail/weiyimin@igengmei.com/zhaojianwei@igengmei.com/search_related
\ No newline at end of file
This diff is collapsed.
SELECT
day_id AS `日期`
,query AS `关键词`
,search_pv AS `搜索量`
,search_uv AS `搜索uv`
,NVL(case when NVL(t2.page_more_pv,0)>0 then concat(round(t2.more_click_pv*100/t2.page_more_pv,2) ,'%') else 0 end, 0) as `搜索综合结果页内容卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(t2.page_more_pv,0)>0 then concat(round(t2.more_click_10_pv*100/t2.page_more_pv,2) ,'%') else 0 end,0) as `搜索综合结果页前10内容卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(t2.page_more_pv,0)>0 then concat(round(t2.more_click_5_diary_pv*100/t2.page_more_pv,2),'%') else 0 end,0) as `搜索综合结果页前5日记卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(t2.page_more_pv,0)>0 then concat(round(t2.more_click_5_answer_pv*100/t2.page_more_pv,2),'%') else 0 end,0) as `搜索综合结果页前5问答卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(t2.page_more_pv,0)>0 then concat(round(t2.more_click_5_topic_pv*100/t2.page_more_pv,2),'%') else 0 end,0) as `搜索综合结果页前5帖子卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(t2.page_wel_pv,0)>0 then concat(round(t2.wel_click_pv*100/t2.page_wel_pv,2),'%') else 0 end,0) as `搜索美购结果页卡片点击PV/搜索美购结果页pv`
,NVL(case when NVL(t2.page_wel_pv,0)>0 then concat(round(t2.wel_click_10_pv*100/t2.page_wel_pv,2),'%') else 0 end,0) as `搜索美购结果页前10卡片点击PV/搜索美购结果页pv`
,NVL(case when NVL(t2.page_wel_pv,0)>0 then concat(round(t2.wel_click_5_pv*100/t2.page_wel_pv,2),'%') else 0 end,0) as `搜索美购结果页前5卡片点击PV/搜索美购结果页pv`
,NVL(case when NVL(t2.page_diary_pv,0)>0 then concat(round(t2.diary_click_pv*100/t2.page_diary_pv,2),'%') else 0 end,0) as `搜索日记结果页卡片点击PV/搜索日记结果页pv`
,NVL(case when NVL(t2.page_diary_pv,0)>0 then concat(round(t2.diary_click_10_pv*100/t2.page_diary_pv,2),'%') else 0 end,0) as `搜索日记结果页前10卡片点击PV/搜索日记结果页pv`
,NVL(case when NVL(t2.page_diary_pv,0)>0 then concat(round(t2.diary_click_5_pv*100/t2.page_diary_pv,2),'%') else 0 end,0) as `搜索日记结果页前5卡片点击PV/搜索日记结果页pv`
,search_more_pv AS `综合tab下的搜索的点击pv`
,page_more_pv AS `搜索综合结果页浏览PV`
,more_click_pv AS `搜索综合结果页内容卡片点击PV`
,more_click_10_pv AS `搜索综合结果页前10内容卡片点击PV`
,more_click_5_diary_pv AS `搜索综合结果页前5日记卡片点击PV`
,more_click_5_answer_pv AS `搜索综合结果页前5问答卡片点击PV`
,more_click_5_topic_pv AS `搜索综合结果页前5帖子卡片点击PV`
,search_wel_pv AS `美购tab下的搜索的点击pv`
,page_wel_pv AS `搜索美购结果页浏览pv`
,wel_click_pv AS `搜索美购结果页卡片点击PV`
,wel_click_10_pv AS `搜索美购结果页前10卡片点击PV`
,wel_click_5_pv AS `搜索美购结果页前5卡片点击PV`
,search_diary_pv AS `日记tab下的搜索的点击pv`
,page_diary_pv AS `搜索日记结果页浏览pv`
,diary_click_pv AS `搜索日记结果页卡片点击PV`
,diary_click_10_pv AS `搜索日记结果页前10卡片点击PV`
,diary_click_5_pv AS `搜索日记结果页前5卡片点击PV`
FROM pm.tl_pm_search_result_click_rate_d
WHERE partition_day>='20200619' and partition_day<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
order by `日期` desc,`搜索量` desc,`关键词`
--近7天搜索方式的搜索量
SELECT regexp_replace(DATE_SUB(current_date,1) ,'-','') AS `日期`,
T3.QUERY AS `搜索词`,
T3.INPUT_TYPE AS `搜索类型`,
T3.SEARCH_PV AS `搜索量`
FROM (SELECT T2.*,
SUM(SEARCH_PV_ALL) OVER(PARTITION BY T2.QUERY) SEARCH_PV_SUM,
ROW_NUMBER() OVER(PARTITION BY T2.QUERY ORDER BY SEARCH_PV DESC) SEARCH_PV_GROUP_SUM
FROM (SELECT T1.*,
CASE
WHEN INPUT_TYPE = '全部' THEN
0
ELSE
1
END INPUT_TYPE_RANK,
CASE
WHEN INPUT_TYPE = '全部' THEN
SEARCH_PV
ELSE
0
END SEARCH_PV_ALL
FROM (SELECT QUERY,INPUT_TYPE,SUM(SEARCH_PV) AS SEARCH_PV
FROM PM.TL_PM_SEARCH_INPUT_TYPE_D T
WHERE T.PARTITION_DAY >= regexp_replace(DATE_SUB(current_date,7) ,'-','')
AND T.PARTITION_DAY<regexp_replace((current_date),'-','')
AND T.DAY_ID >= regexp_replace(DATE_SUB(current_date,7) ,'-','')
AND T.DAY_ID<regexp_replace((current_date),'-','')
GROUP BY T.QUERY,T.INPUT_TYPE) T1) T2)T3
ORDER BY T3.SEARCH_PV_SUM DESC,
T3.QUERY,
T3.INPUT_TYPE_RANK,
T3.SEARCH_PV_GROUP_SUM
\ No newline at end of file
......@@ -5,17 +5,17 @@ SELECT
,query AS `关键词`
,search_pv AS `搜索量`
,search_uv AS `搜索uv`
,NVL(case when NVL(t2.page_more_pv,0)>0 then concat(round(t2.more_click_pv*100/t2.page_more_pv,2) ,'%') else 0 end, 0) as `搜索综合结果页内容卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(t2.page_more_pv,0)>0 then concat(round(t2.more_click_10_pv*100/t2.page_more_pv,2) ,'%') else 0 end,0) as `搜索综合结果页前10内容卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(t2.page_more_pv,0)>0 then concat(round(t2.more_click_5_diary_pv*100/t2.page_more_pv,2),'%') else 0 end,0) as `搜索综合结果页前5日记卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(t2.page_more_pv,0)>0 then concat(round(t2.more_click_5_answer_pv*100/t2.page_more_pv,2),'%') else 0 end,0) as `搜索综合结果页前5问答卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(t2.page_more_pv,0)>0 then concat(round(t2.more_click_5_topic_pv*100/t2.page_more_pv,2),'%') else 0 end,0) as `搜索综合结果页前5帖子卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(t2.page_wel_pv,0)>0 then concat(round(t2.wel_click_pv*100/t2.page_wel_pv,2),'%') else 0 end,0) as `搜索美购结果页卡片点击PV/搜索美购结果页pv`
,NVL(case when NVL(t2.page_wel_pv,0)>0 then concat(round(t2.wel_click_10_pv*100/t2.page_wel_pv,2),'%') else 0 end,0) as `搜索美购结果页前10卡片点击PV/搜索美购结果页pv`
,NVL(case when NVL(t2.page_wel_pv,0)>0 then concat(round(t2.wel_click_5_pv*100/t2.page_wel_pv,2),'%') else 0 end,0) as `搜索美购结果页前5卡片点击PV/搜索美购结果页pv`
,NVL(case when NVL(t2.page_diary_pv,0)>0 then concat(round(t2.diary_click_pv*100/t2.page_diary_pv,2),'%') else 0 end,0) as `搜索日记结果页卡片点击PV/搜索日记结果页pv`
,NVL(case when NVL(t2.page_diary_pv,0)>0 then concat(round(t2.diary_click_10_pv*100/t2.page_diary_pv,2),'%') else 0 end,0) as `搜索日记结果页前10卡片点击PV/搜索日记结果页pv`
,NVL(case when NVL(t2.page_diary_pv,0)>0 then concat(round(t2.diary_click_5_pv*100/t2.page_diary_pv,2),'%') else 0 end,0) as `搜索日记结果页前5卡片点击PV/搜索日记结果页pv`
,NVL(case when NVL(page_more_pv,0)>0 then concat(round(more_click_pv*100/page_more_pv,2) ,'%') else 0 end, 0) as `搜索综合结果页内容卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(page_more_pv,0)>0 then concat(round(more_click_10_pv*100/page_more_pv,2) ,'%') else 0 end,0) as `搜索综合结果页前10内容卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(page_more_pv,0)>0 then concat(round(more_click_5_diary_pv*100/page_more_pv,2),'%') else 0 end,0) as `搜索综合结果页前5日记卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(page_more_pv,0)>0 then concat(round(more_click_5_answer_pv*100/page_more_pv,2),'%') else 0 end,0) as `搜索综合结果页前5问答卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(page_more_pv,0)>0 then concat(round(more_click_5_topic_pv*100/page_more_pv,2),'%') else 0 end,0) as `搜索综合结果页前5帖子卡片点击PV/搜索综合结果页浏览pv`
,NVL(case when NVL(page_wel_pv,0)>0 then concat(round(wel_click_pv*100/page_wel_pv,2),'%') else 0 end,0) as `搜索美购结果页卡片点击PV/搜索美购结果页pv`
,NVL(case when NVL(page_wel_pv,0)>0 then concat(round(wel_click_10_pv*100/page_wel_pv,2),'%') else 0 end,0) as `搜索美购结果页前10卡片点击PV/搜索美购结果页pv`
,NVL(case when NVL(page_wel_pv,0)>0 then concat(round(wel_click_5_pv*100/page_wel_pv,2),'%') else 0 end,0) as `搜索美购结果页前5卡片点击PV/搜索美购结果页pv`
,NVL(case when NVL(page_diary_pv,0)>0 then concat(round(diary_click_pv*100/page_diary_pv,2),'%') else 0 end,0) as `搜索日记结果页卡片点击PV/搜索日记结果页pv`
,NVL(case when NVL(page_diary_pv,0)>0 then concat(round(diary_click_10_pv*100/page_diary_pv,2),'%') else 0 end,0) as `搜索日记结果页前10卡片点击PV/搜索日记结果页pv`
,NVL(case when NVL(page_diary_pv,0)>0 then concat(round(diary_click_5_pv*100/page_diary_pv,2),'%') else 0 end,0) as `搜索日记结果页前5卡片点击PV/搜索日记结果页pv`
,search_more_pv AS `综合tab下的搜索的点击pv`
,page_more_pv AS `搜索综合结果页浏览PV`
,more_click_pv AS `搜索综合结果页内容卡片点击PV`
......@@ -36,4 +36,6 @@ SELECT
FROM pm.tl_pm_search_result_click_rate_d
WHERE partition_day>='20200619' and partition_day<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and day_id>=regexp_replace(DATE_SUB(current_date,7) ,'-','')
and day_id<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
order by `日期` desc,`搜索量` desc,`关键词`
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