Commit f9f54c57 authored by yindanlei's avatar yindanlei

add search_daily_data report codes

parent 8a1584e1
......@@ -4,7 +4,7 @@
--*业务名称: pm
--*输入数据:
--*作者: yindanlei@igengmei.com
--*更新时间:2020-07-13
--*更新时间:2020-08-07
--***************************************************************
--设置全局变量&UDF
......@@ -17,37 +17,21 @@ USE pm;
CREATE TABLE IF NOT EXISTS pm.tl_pm_search_d
(
day_id string comment '{"chs_name":"日期","description":"","etl":"","value":"","remark":""}',
device_os_type string comment '{"chs_name":"设备类型","description":"","etl":"","value":"","remark":""}',
device_os_type string comment '{"chs_name":"平台","description":"","etl":"","value":"","remark":""}',
active_type string comment '{"chs_name":"活跃类型","description":"","etl":"","value":"","remark":""}',
channel string comment '{"chs_name":"渠道类型","description":"","etl":"","value":"","remark":""}',
dau int comment '{"chs_name":"DAU","description":"","etl":"","value":"","remark":""}',
all_search_uv int comment '{"chs_name":"总完成搜索uv(含首页猜你喜欢、美购首页大家都在搜)","description":"","etl":"","value":"","remark":""}',
all_search_uv/dau double comment '{"chs_name":"总完成搜索uv/DAU","description":"","etl":"","value":"","remark":""}',
all_search_pv/all_search_uv double comment '{"chs_name":"总完成搜索pv/总完成搜索uv","description":"","etl":"","value":"","remark":""}',
search_result_more_all_click_pv/search_result_more_pv double comment '{"chs_name":"搜索综合页正向点击pv/搜索综合页面pv","description":"","etl":"","value":"","remark":""}',
search_result_more_card_click_pv/search_result_more_pv double comment '{"chs_name":"搜索结果综合页所有卡片点击pv(含AI)/搜索结果综合页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_welfare_card_click_pv/search_result_welfare_pv double comment '{"chs_name":"搜索结果美购页所有卡片点击pv/搜索结果美购页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_hospital_card_click_pv/search_result_hospital_pv double comment '{"chs_name":"搜索结果医院页所有卡片点击pv/搜索结果医院页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_doctor_card_click_pv/search_result_doctor_pv double comment '{"chs_name":"搜索结果医生页所有卡片点击pv/搜索结果医生页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_diary_card_click_pv/search_result_diary_pv double comment '{"chs_name":"搜索结果日记页所有卡片点击pv/搜索结果日记页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_post_card_click_pv/search_result_post_pv double comment '{"chs_name":"搜索结果帖子页所有卡片点击pv/搜索结果帖子页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_wiki_card_click_pv/search_result_wiki_pv double comment '{"chs_name":"搜索结果百科页所有卡片点击pv/搜索结果百科页浏览pv","description":"","etl":"","value":"","remark":""}',
all_search_click_pv int comment '{"chs_name":"点击搜索框pv(724及以上)","description":"","etl":"","value":"","remark":""}',
navbar_search_pv/all_search_click_pv double comment '{"chs_name":"通过搜索框完成搜索总pv/点击搜索框pv(724及以上)","description":"","etl":"","value":"","remark":""}',
sug_search_pv/sug_out_pv double comment '{"chs_name":"sug搜索pv/sug弹窗弹出pv(726及以上)","description":"","etl":"","value":"","remark":""}',
home_youlike_search_pv/home_you_like_grey_type_pv double comment '{"chs_name":"首页猜你喜欢点击pv/灰度设备首页浏览pv(723及以上5%灰度)","description":"","etl":"","value":"","remark":""}',
faxain_search_pv/search_home_pv double comment '{"chs_name":"搜索首页发现搜索pv/搜索首页浏览pv","description":"","etl":"","value":"","remark":""}',
lishi_search_pv/search_home_pv double comment '{"chs_name":"搜索首页历史搜索pv/搜索首页浏览pv","description":"","etl":"","value":"","remark":""}',
allsee_search_pv/search_home_pv double comment '{"chs_name":"搜索首页大家都在看搜索pv/搜索首页浏览pv","description":"","etl":"","value":"","remark":""}',
home_morenci_search_pv/home_search_click_pv double comment '{"chs_name":"首页默认词搜索pv/首页搜索框点击pv(727及以上)","description":"","etl":"","value":"","remark":""}',
welfare_home_morenci_search_pv/welfare_home_search_click_pv double comment '{"chs_name":"美购首页默认词搜索pv/美购首页搜索框点击pv(727及以上)","description":"","etl":"","value":"","remark":""}',
content_detail_search_pv/content_detail_search_grey_pv double comment '{"chs_name":"内容详情页点击搜索按钮完成默认词搜索pv/灰度设备内容详情页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_welfare_pv/all_search_result_pv double comment '{"chs_name":"搜索结果美购页浏览pv/搜索结果(全部tab)页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_hospital_pv/all_search_result_pv double comment '{"chs_name":"搜索结果医院页浏览pv/搜索结果(全部tab)页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_doctor_pv/all_search_result_pv double comment '{"chs_name":"搜索结果医生页浏览pv/搜索结果(全部tab)页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_diary_pv/all_search_result_pv double comment '{"chs_name":"搜索结果日记页浏览pv/搜索结果(全部tab)页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_post_pv/all_search_result_pv double comment '{"chs_name":"搜索结果帖子页浏览pv/搜索结果(全部tab)页浏览pv","description":"","etl":"","value":"","remark":""}',
search_result_wiki_pv/all_search_result_pv double comment '{"chs_name":"搜索结果百科页浏览pv/搜索结果(全部tab)页浏览pv","description":"","etl":"","value":"","remark":""}'
all_search_uv int comment '{"chs_name":"完成搜索uv","description":"","etl":"","value":"","remark":""}',
all_search_pv int comment '{"chs_name":"完成搜索pv","description":"","etl":"","value":"","remark":""}',
all_search_uv/dau double comment '{"chs_name":"完成搜索的用户比例","description":"","etl":"","value":"","remark":""}',
all_search_pv/all_search_uv double comment '{"chs_name":"搜索用户人均使用次数","description":"","etl":"","value":"","remark":""}',
all_search_pv/search_home_pv double comment '{"chs_name":"搜索成功率","description":"","etl":"","value":"","remark":""}',
sug_search_pv_726/sug_out_pv_726 double comment '{"chs_name":"sug使用率","description":"","etl":"","value":"","remark":""}',
referrer_search_hexin_pv/all_search_uv double comment '{"chs_name":"来源于搜索的核心页pv/搜索uv","description":"","etl":"","value":"","remark":""}',
referrer_search_neirong_pv/all_search_uv double comment '{"chs_name":"来源于搜索的内容页pv/搜索uv","description":"","etl":"","value":"","remark":""}',
search_hexin_two_pv/referrer_search_hexin_pv double comment '{"chs_name":"来源于搜索的核心页二跳率","description":"","etl":"","value":"","remark":""}',
search_neirong_two_pv/referrer_search_neirong_pv double comment '{"chs_name":"来源于搜索的内容页二跳率","description":"","etl":"","value":"","remark":""}',
referrer_search_neirong_pagestay double comment '{"chs_name":"来源于搜索的内容平均浏览时长(m)","description":"","etl":"","value":"","remark":""}'
)comment '搜索日报'
PARTITIONED BY (PARTITION_DAY STRING comment '分区日期')
ROW FORMAT DELIMITED
......
#step1_2.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive al al_pm_ct_dv_deviceappversionrollbackfrom20190101_d
\ No newline at end of file
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_ydl
\ No newline at end of file
#step1_3.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_ydl
\ No newline at end of file
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 online bl_hdfs_maidian_updates
\ No newline at end of file
#step1_5.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
#step2.job
type=command
dependencies=step1_1,step1_2,step1_3,step1_4,step1_5
dependencies=step1_1,step1_2,step1_3
command=/home/bi/bi-report/lib/shell/hive search_daily_data
\ No newline at end of file
#step3.job
type=command
dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/search_daily_data/dengguangyu@igengmei.com/liudi@igengmei.com,wangxin@igengmei.com,duanyingrong@igengmei.com,lixiaofang@igengmei.com,zhaofei@igengmei.com,yindanlei@igengmei.com,weiyimin@igengmei.com,wangzhuo@igengmei.com,wangyan@igengmei.com
\ No newline at end of file
command=curl -X GET http://localhost:8553/api/report/email/search_daily_data/cp-sunyinghe@igengmei.com@igengmei.com/wangsijing@igengmei.com,yindanlei@igengmei.com,wangyan@igengmei.com
\ No newline at end of file
......@@ -2,36 +2,20 @@
SELECT
day_id AS `日期`
,device_os_type AS `设备类型`
,device_os_type AS `平台`
,active_type AS `活跃类型`
,channel AS `渠道类型`
,dau AS `DAU`
,all_search_uv AS `总完成搜索uv(含首页猜你喜欢、美购首页大家都在搜)`
,all_search_uv/dau AS `总完成搜索uv/DAU`
,all_search_pv/all_search_uv AS `总完成搜索pv/总完成搜索uv`
,search_result_more_all_click_pv/search_result_more_pv AS `搜索综合页正向点击pv/搜索综合页面pv`
,search_result_more_card_click_pv/search_result_more_pv AS `搜索结果综合页所有卡片点击pv(含AI)/搜索结果综合页浏览pv`
,search_result_welfare_card_click_pv/search_result_welfare_pv AS `搜索结果美购页所有卡片点击pv/搜索结果美购页浏览pv`
,search_result_hospital_card_click_pv/search_result_hospital_pv AS `搜索结果医院页所有卡片点击pv/搜索结果医院页浏览pv`
,search_result_doctor_card_click_pv/search_result_doctor_pv AS `搜索结果医生页所有卡片点击pv/搜索结果医生页浏览pv`
,search_result_diary_card_click_pv/search_result_diary_pv AS `搜索结果日记页所有卡片点击pv/搜索结果日记页浏览pv`
,search_result_post_card_click_pv/search_result_post_pv AS `搜索结果帖子页所有卡片点击pv/搜索结果帖子页浏览pv`
,search_result_wiki_card_click_pv/search_result_wiki_pv AS `搜索结果百科页所有卡片点击pv/搜索结果百科页浏览pv`
,all_search_click_pv AS `点击搜索框pv(724及以上)`
,navbar_search_pv/all_search_click_pv AS `通过搜索框完成搜索总pv/点击搜索框pv(724及以上)`
,sug_search_pv/sug_out_pv AS `sug搜索pv/sug弹窗弹出pv(726及以上)`
,home_youlike_search_pv/home_you_like_grey_type_pv AS `首页猜你喜欢点击pv/灰度设备首页浏览pv(723及以上5%灰度)`
,faxain_search_pv/search_home_pv AS `搜索首页发现搜索pv/搜索首页浏览pv`
,lishi_search_pv/search_home_pv AS `搜索首页历史搜索pv/搜索首页浏览pv`
,allsee_search_pv/search_home_pv AS `搜索首页大家都在看搜索pv/搜索首页浏览pv`
,home_morenci_search_pv/home_search_click_pv AS `首页默认词搜索pv/首页搜索框点击pv(727及以上)`
,welfare_home_morenci_search_pv/welfare_home_search_click_pv AS `美购首页默认词搜索pv/美购首页搜索框点击pv(727及以上)`
,content_detail_search_pv/content_detail_search_grey_pv AS `内容详情页点击搜索按钮完成默认词搜索pv/灰度设备内容详情页浏览pv`
,search_result_welfare_pv/all_search_result_pv AS `搜索结果美购页浏览pv/搜索结果(全部tab)页浏览pv`
,search_result_hospital_pv/all_search_result_pv AS `搜索结果医院页浏览pv/搜索结果(全部tab)页浏览pv`
,search_result_doctor_pv/all_search_result_pv AS `搜索结果医生页浏览pv/搜索结果(全部tab)页浏览pv`
,search_result_diary_pv/all_search_result_pv AS `搜索结果日记页浏览pv/搜索结果(全部tab)页浏览pv`
,search_result_post_pv/all_search_result_pv AS `搜索结果帖子页浏览pv/搜索结果(全部tab)页浏览pv`
,search_result_wiki_pv/all_search_result_pv AS `搜索结果百科页浏览pv/搜索结果(全部tab)页浏览pv`
,all_search_uv AS `完成搜索uv`
,all_search_pv AS `完成搜索pv`
,all_search_uv/dau AS `完成搜索的用户比例`
,all_search_pv/all_search_uv AS `搜索用户人均使用次数`
,all_search_pv/search_home_pv AS `搜索成功率`
,sug_search_pv_726/sug_out_pv_726 AS `sug使用率`
,referrer_search_hexin_pv/all_search_uv AS `来源于搜索的核心页pv/搜索uv`
,referrer_search_neirong_pv/all_search_uv AS `来源于搜索的内容页pv/搜索uv`
,search_hexin_two_pv/referrer_search_hexin_pv AS `来源于搜索的核心页二跳率`
,search_neirong_two_pv/referrer_search_neirong_pv AS `来源于搜索的内容页二跳率`
,referrer_search_neirong_pagestay AS `来源于搜索的内容平均浏览时长(m)`
FROM pm.tl_pm_search_d
where partition_day=regexp_replace(DATE_SUB(current_date,1) ,'-','')
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