Commit 299d2139 authored by 魏艺敏's avatar 魏艺敏

push codes

parent f8266f58
......@@ -4,3 +4,4 @@ home_content_by_month=首页内容数据-月均
ai_content_detail=ai内容数据-分日明细
ai_content_by_month=ai内容数据-月均
home_content_retention=分类用户次留
search_content_detail=搜索到内容的转化
\ No newline at end of file
--***************************************************************
--*脚本名称:
--*功能: 内容日报-简化版-for 思璟
--*业务名称: pm
--*输入数据:
--*作者: weiyimin@igengmei.com
--*更新时间:
--***************************************************************
--设置全局变量&UDF
SET mapreduce.job.queuename=data;
--使用bl数据库
USE pm;
--创建BL层内部表
CREATE TABLE IF NOT EXISTS pm.tl_pm_search_content
(
day_id 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 BIGINT comment '{"chs_name":"日活","description":"","etl":"","value":"","remark":""}',
search_uv BIGINT comment '{"chs_name":"搜索uv","description":"","etl":"","value":"","remark":""}',
search_uv_in_dau string comment '{"chs_name":"搜索uv/dau","description":"","etl":"","value":"","remark":""}',
do_search_uv BIGINT comment '{"chs_name":"完成搜索uv","description":"","etl":"","value":"","remark":""}',
do_search_pv BIGINT comment '{"chs_name":"完成搜索pv","description":"","etl":"","value":"","remark":""}',
do_search_rate string comment '{"chs_name":"完成搜索的用户比例","description":"","etl":"","value":"","remark":""}',
search_times string comment '{"chs_name":"搜索用户人均使用次数","description":"","etl":"","value":"","remark":""}',
search_diary_to_content_uv BIGINT comment '{"chs_name":"来源于搜索日记tab的日记及帖子页uv","description":"","etl":"","value":"","remark":""}',
search_diary_to_content_pv BIGINT comment '{"chs_name":"来源于搜索日记tab的日记及帖子页pv","description":"","etl":"","value":"","remark":""}',
search_diary_to_content_uv_rate string comment '{"chs_name":"来源于搜索日记tab的日记及帖子页uv/搜索uv","description":"","etl":"","value":"","remark":""}',
search_qa_to_content_uv BIGINT comment '{"chs_name":"来源于搜索问答tab的问答页uv","description":"","etl":"","value":"","remark":""}',
search_qa_to_content_pv BIGINT comment '{"chs_name":"来源于搜索问答tab的问答页pv","description":"","etl":"","value":"","remark":""}',
search_qa_to_content_uv_rate string comment '{"chs_name":"来源于搜索问答tab的问答页uv/搜索uv","description":"","etl":"","value":"","remark":""}',
diary_tab_ctr string comment '{"chs_name":"日记tab ctr","description":"","etl":"","value":"","remark":""}',
diary_tab_pv_per_uv string comment '{"chs_name":"日记tab卡片点击pv/uv","description":"","etl":"","value":"","remark":""}',
qa_tab_ctr string comment '{"chs_name":"问答tab ctr","description":"","etl":"","value":"","remark":""}',
qa_tab_pv_per_uv string comment '{"chs_name":"问答tab卡片点击pv/uv","description":"","etl":"","value":"","remark":""}',
content_pv_in_search_uv string comment '{"chs_name":"来源于搜索日记和问答tab的内容页PV/搜索uv","description":"","etl":"","value":"","remark":""}',
diary_second_pv_in_search_uv string comment '{"chs_name":"来源于搜索日记tab的内容二跳PV/搜索uv","description":"","etl":"","value":"","remark":""}',
qa_second_pv_in_search_uv string comment '{"chs_name":"来源于搜索问答tab的内容二跳PV/搜索uv","description":"","etl":"","value":"","remark":""}',
content_pagestay_in_search_uv string comment '{"chs_name":"来源于搜索日记及问答tab的内容总时长/搜索uv(s)","description":"","etl":"","value":"","remark":""}',
avg_contents string comment '{"chs_name":"完成搜索用户人均阅读内容篇数","description":"","etl":"","value":"","remark":""}',
search_retention string comment '{"chs_name":"功能次留","description":"","etl":"","value":"","remark":""}'
)comment '内容日报-搜索到内容的转化'
PARTITIONED BY (PARTITION_DAY STRING comment '分区日期')
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY '\002'
MAP KEYS TERMINATED BY '\003'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE;
\ No newline at end of file
This diff is collapsed.
#step3.job
type=command
dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/daily_content/weiyimin@igengmei.com/hanyingyue@igengmei.com,jiaqingqing@igengmei.com
\ No newline at end of file
command=curl -X GET http://localhost:8553/api/report/email/daily_content/liudi@igengmei.com,shenzheng@igengmei.com,wangxin@igengmei.com,zhaoyang@igengmei.com/weiyimin@igengmei.com,hanyingyue@igengmei.com,jiaqingqing@igengmei.com
\ No newline at end of file
......@@ -3,12 +3,12 @@ select substr(day_id,1,6) `日期`
,active_type `活跃`
,channel `渠道`
,round(avg(home_good_click_uv),0) as `首页good click设备数`
,round(avg(if(home_good_click_quality=0,NULL,home_good_click_quality)),2) as `首页gc用户次留率/全站次留率`
,concat(round(avg(if(home_good_click_quality=0,NULL,home_good_click_quality))*100,2),'%') as `首页gc用户次留率/全站次留率`
,round(avg(home_ungood_click_uv),0) as `点击首页卡片但非gc设备数`
,round(avg(if(home_ungood_click_quality=0,NULL,home_ungood_click_quality)),2) as `点击首页卡片但非gc设备次留率/全站次留率`
,concat(round(avg(if(home_ungood_click_quality=0,NULL,home_ungood_click_quality))*100,2),'%') as `点击首页卡片但非gc设备次留率/全站次留率`
,round(avg(no_click_uv),0) as `未点击首页feed卡片设备数`
,round(avg(if(no_click_uv_quality=0,NULL,no_click_uv_quality)),2) as `未点击首页feed卡片设备次留率/全站次留率`
,round(avg(if(home_good_click_retention_quality=0,NULL,home_good_click_retention_quality)),2) as `当天点击首页feed卡片,且次日依旧点击的次留率/全站次留率`
,concat(round(avg(if(no_click_uv_quality=0,NULL,no_click_uv_quality))*100,2),'%') as `未点击首页feed卡片设备次留率/全站次留率`
,concat(round(avg(if(home_good_click_retention_quality=0,NULL,home_good_click_retention_quality))*100,2),'%') as `当天点击首页feed卡片,且次日依旧点击的次留率/全站次留率`
FROM pm.tl_pm_content_retention
where partition_day>='20201018' and partition_day <= regexp_replace(DATE_SUB(current_date,1) ,'-','')
group by substr(day_id,1,6),device_os_type,active_type,channel
......
select day_id as `日期`
,device_os_type as `平台`
,active_type as `活跃类型`
,channel as `渠道类型`
,dau as `dau`
,search_uv as `搜索uv`
,search_uv_in_dau as `搜索uv/dau`
,do_search_uv as `完成搜索uv`
,do_search_pv as `完成搜索pv`
,do_search_rate as `完成搜索的用户比例`
,search_times as `搜索用户人均使用次数`
,search_diary_to_content_uv`来源于搜索日记tab的日记及帖子页uv`
,search_diary_to_content_pv `来源于搜索日记tab的日记及帖子页pv`
,search_diary_to_content_uv_rate`来源于搜索日记tab的日记及帖子页uv/搜索uv`
,search_qa_to_content_uv`来源于搜索问答tab的问答页uv`
,search_qa_to_content_pv`来源于搜索问答tab的问答页pv`
,search_qa_to_content_uv_rate`来源于搜索问答tab的问答页uv/搜索uv`
,diary_tab_ctr`日记tab ctr`
,diary_tab_pv_per_uv`日记tab卡片点击pv/uv`
,qa_tab_ctr`问答tab ctr`
,qa_tab_pv_per_uv`问答tab卡片点击pv/uv`
,content_pv_in_search_uv as `来源于搜索日记和问答tab的内容页PV/搜索uv`
,concat(round(count(distinct case when total_diary_second_pv>0 then t4.cl_id end )/count(distinct case when t4.search_pv>0 then t4.cl_id end)*100,2),'%')`diary_second_pv_in_search_uv`
,concat(round(count(distinct case when total_qa_second_pv>0 then t4.cl_id end )/count(distinct case when t4.search_pv>0 then t4.cl_id end)*100,2),'%')`qa_second_pv_in_search_uv`
,round(sum(referrer_search_pagestay)/count(distinct case when t4.search_pv>0 then t4.cl_id end),2) as `content_pagestay_in_search_uv`
,round(sum(business_id_num)/count(distinct t2.cl_id),2) as `avg_contents`
,concat(round(count(distinct t3.cl_id)/count(distinct t2.cl_id)*100,2),'%') as `search_retention`
FROM pm.tl_pm_search_content
where partition_day>='20201109' and partition_day <= regexp_replace(DATE_SUB(current_date,1) ,'-','')
order by `日期`,`系统`,`活跃`,`渠道`
\ No newline at end of file
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