Commit 106ded3a authored by 赵建伟's avatar 赵建伟

Merge branch 'weiyimin' into 'master'

Weiyimin

See merge request !13
parents a6e3fda4 3f7b9d6d
This diff is collapsed.
......@@ -614,7 +614,7 @@ LEFT JOIN
AND partition_date < regexp_replace((current_date),'-','')
AND page_name = 'home'
AND action = 'on_click_card'
AND params['transaction_type'] not in ('-1','ctr','cvr','smr','newdata')
AND params['transaction_type'] not in ('-1','ctr','cvr','smr','newdata','hotspot','pgc','samecity_ctr')
AND params['card_content_type'] IN ('diary','diary_topic','user_post','doctor_post','question','answer','qa','live','article')
UNION ALL
......@@ -626,7 +626,7 @@ LEFT JOIN
AND partition_date < regexp_replace((current_date),'-','')
AND page_name = 'home'
AND action in ( 'on_click_diary_card','on_click_answer_card','on_click_question_card','on_click_topic_card','on_click_live_card')
AND params['transaction_type'] not in ('-1','ctr','cvr','smr','newdata')
AND params['transaction_type'] not in ('-1','ctr','cvr','smr','newdata','hotspot','pgc','samecity_ctr')
UNION ALL
......@@ -637,7 +637,7 @@ LEFT JOIN
AND partition_date < regexp_replace((current_date),'-','')
AND page_name = 'home'
AND action = 'on_click_card'
AND params['transaction_type'] in ('-1','ctr','cvr','smr','newdata')
AND params['transaction_type'] in ('-1','ctr','cvr','smr','newdata','hotspot','pgc','samecity_ctr')
AND params['card_content_type'] IN ('diary','diary_topic','user_post','doctor_post','question','answer','qa','live','article')
UNION ALL
......@@ -649,7 +649,7 @@ LEFT JOIN
AND partition_date < regexp_replace((current_date),'-','')
AND page_name = 'home'
AND action in ('on_click_diary_card','on_click_answer_card','on_click_question_card','on_click_topic_card','on_click_live_card')
AND params['transaction_type'] in ('-1','ctr','cvr','smr','newdata')
AND params['transaction_type'] in ('-1','ctr','cvr','smr','newdata','hotspot','pgc','samecity_ctr')
)t2
ON t1.partition_date=t2.partition_date
AND t1.device_id=t2.cl_id
......
#step3.job
type=command
dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/daily_content_data/liudi@igengmei.com,wangxin@igengmei.com,malinxi@igengmei.com,dengguangyu@igengmei.com/weiyimin@igengmei.com,zhaojianwei@igengmei.com,zhaofei@igengmei.com,yindanlei@igengmei.com
\ No newline at end of file
command=curl -X GET http://localhost:8553/api/report/email/daily_content_data/liudi@igengmei.com,wangxin@igengmei.com,dengguangyu@igengmei.com/weiyimin@igengmei.com,zhaofei@igengmei.com,yindanlei@igengmei.com
\ No newline at end of file
daily_push=push日报-策略方向
daily_push_click=push拉起设备数据
personal_push_received=push接收设备数据
\ No newline at end of file
--***************************************************************
--*脚本名称:
--*功能: push日报
--*业务名称: pm
--*输入数据:
--*作者: weiyimin@igengmei.com
--*更新时间:
--***************************************************************
--设置全局变量&UDF
SET mapreduce.job.queuename=data;
--使用bl数据库
USE pm;
--创建BL层内部表
CREATE TABLE IF NOT EXISTS pm.tl_pm_push_d
(
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":""}',
dau BIGINT comment '{"chs_name":"DAU","description":"","etl":"","value":"","remark":""}',
is_open_uv BIGINT comment '{"chs_name":"push开启设备数","description":"","etl":"","value":"","remark":""}',
push_open_uv BIGINT comment '{"chs_name":"push拉起设备数","description":"","etl":"","value":"","remark":""}',
push_open_pv BIGINT comment '{"chs_name":"push拉起人次","description":"","etl":"","value":"","remark":""}',
push_open_2_uv BIGINT comment '{"chs_name":"push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
push_open_2_pv BIGINT comment '{"chs_name":"push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
op_push_open_uv BIGINT comment '{"chs_name":"运营push拉起设备数","description":"","etl":"","value":"","remark":""}',
op_push_open_pv BIGINT comment '{"chs_name":"运营push拉起人次","description":"","etl":"","value":"","remark":""}',
op_push_open_2_uv BIGINT comment '{"chs_name":"运营push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
op_push_open_2_pv BIGINT comment '{"chs_name":"运营push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
auto_push_open_uv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起设备数","description":"","etl":"","value":"","remark":""}',
auto_push_open_pv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起人次","description":"","etl":"","value":"","remark":""}',
auto_push_open_2_uv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
auto_push_open_2_pv BIGINT comment '{"chs_name":"除运营、个性化、签到、意愿外push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
will_push_open_uv BIGINT comment '{"chs_name":"意愿探索push拉起设备数","description":"","etl":"","value":"","remark":""}',
will_push_open_pv BIGINT comment '{"chs_name":"意愿探索push拉起人次","description":"","etl":"","value":"","remark":""}',
will_push_open_2_uv BIGINT comment '{"chs_name":"意愿探索push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
will_push_open_2_pv BIGINT comment '{"chs_name":"意愿探索push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
sign_push_open_uv BIGINT comment '{"chs_name":"签到push拉起设备数","description":"","etl":"","value":"","remark":""}',
sign_push_open_pv BIGINT comment '{"chs_name":"签到push拉起人次","description":"","etl":"","value":"","remark":""}',
sign_push_open_2_uv BIGINT comment '{"chs_name":"签到push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
sign_push_open_2_pv BIGINT comment '{"chs_name":"签到push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
personal_push_open_uv BIGINT comment '{"chs_name":"个性化push拉起设备数","description":"","etl":"","value":"","remark":""}',
personal_push_open_pv BIGINT comment '{"chs_name":"个性化push拉起人次","description":"","etl":"","value":"","remark":""}',
personal_push_open_2_uv BIGINT comment '{"chs_name":"个性化push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
personal_push_open_2_pv BIGINT comment '{"chs_name":"个性化push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
ctr_push_open_uv BIGINT comment '{"chs_name":"ctr_push拉起设备数","description":"","etl":"","value":"","remark":""}',
ctr_push_open_pv BIGINT comment '{"chs_name":"ctr_push拉起人次","description":"","etl":"","value":"","remark":""}',
ctr_push_open_2_uv BIGINT comment '{"chs_name":"ctr_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
ctr_push_open_2_pv BIGINT comment '{"chs_name":"ctr_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_uv BIGINT comment '{"chs_name":"非ctr_push拉起设备数","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_pv BIGINT comment '{"chs_name":"非ctr_push拉起人次","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_2_uv BIGINT comment '{"chs_name":"非ctr_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
non_ctr_push_open_2_pv BIGINT comment '{"chs_name":"非ctr_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
AI_push_open_uv BIGINT comment '{"chs_name":"AI_push拉起设备数","description":"","etl":"","value":"","remark":""}',
AI_push_open_pv BIGINT comment '{"chs_name":"AI_push拉起人次","description":"","etl":"","value":"","remark":""}',
AI_push_open_2_uv BIGINT comment '{"chs_name":"AI_push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
AI_push_open_2_pv BIGINT comment '{"chs_name":"AI_push拉起有2跳人次","description":"","etl":"","value":"","remark":""}',
orignal_auto_push_open_uv BIGINT comment '{"chs_name":"除运营外push拉起设备数","description":"","etl":"","value":"","remark":""}',
orignal_auto_push_open_pv BIGINT comment '{"chs_name":"除运营外push拉起人次","description":"","etl":"","value":"","remark":""}',
orginal_auto_push_open_2_uv BIGINT comment '{"chs_name":"除运营外push拉起有2跳设备数","description":"","etl":"","value":"","remark":""}',
orginal_auto_push_open_2_pv BIGINT comment '{"chs_name":"除运营外push拉起有2跳人次","description":"","etl":"","value":"","remark":""}'
)comment 'push日报'
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
--***************************************************************
--*脚本名称:
--*功能: push接收数据
--*业务名称: pm
--*输入数据:
--*作者: weiyimin@igengmei.com
--*更新时间:
--***************************************************************
--设置全局变量&UDF
SET mapreduce.job.queuename=data;
--使用bl数据库
USE pm;
--创建BL层内部表
CREATE TABLE IF NOT EXISTS pm.tl_pm_push_receive_d
(
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":""}',
push_type BIGINT comment '{"chs_name":"push类型","description":"","etl":"","value":"","remark":""}',
received_dev_num BIGINT comment '{"chs_name":"push接收设备数","description":"","etl":"","value":"","remark":""}',
received_msg_num BIGINT comment '{"chs_name":"push接收消息数","description":"","etl":"","value":"","remark":""}',
click_dev_num BIGINT comment '{"chs_name":"push点击设备数","description":"","etl":"","value":"","remark":""}',
click_msg_num BIGINT comment '{"chs_name":"push点击消息数","description":"","etl":"","value":"","remark":""}'
)comment 'push接收数据'
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.
#step1_1.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_device_day_active_status
\ No newline at end of file
#step1_2.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online tl_hdfs_push2_new_view
\ 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 tl_hdfs_api_pushtask2_view
\ No newline at end of file
#step1_6.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_device_history_detail
\ No newline at end of file
#step1_7.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive bl bl_et_bg_trackingpushlog_inc_d
\ No newline at end of file
#step2.job
type=command
dependencies=step1_1,step1_2,step1_3,step1_4,step1_5,step1_6,step1_7
command=/home/bi/bi-report/lib/shell/hive daily_push
\ No newline at end of file
#step3_1.job
type=command
dependencies=step2
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_push_click_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_push_receive_d
\ No newline at end of file
#step4.job
type=command
dependencies=step3_1,step3_2
command=curl -X GET http://localhost:8553/api/report/email/daily_push/liweirui@igengmei.com,duanyingrong@igengmei.com,zhaowei@igengmei.com,songke@igengmei.com/zhaofei@igengmei.com
\ No newline at end of file
select day_id as `日期`
,device_os_type as `设备类型`
,active_type as `活跃类型`
,NVL(CONCAT(ROUND(is_open_uv/dau*100,2),'%'),0) as `push开启设备数/DAU`
,NVL(CONCAT(ROUND(op_push_open_uv/is_open_uv*100,2),'%'),0) as `运营push拉起设备/push开启设备数`
,NVL(CONCAT(ROUND(op_push_open_pv/is_open_uv*100,2),'%'),0) as `运营push拉起人次/push开启设备数`
,NVL(CONCAT(ROUND(op_push_open_2_uv/is_open_uv*100,2),'%'),0) as `运营push拉起有2跳设备/push开启设备数`
,NVL(CONCAT(ROUND(op_push_open_2_pv/is_open_uv*100,2),'%'),0) as `运营push拉起有2跳人次/push开启设备数`
,NVL(CONCAT(ROUND(op_push_open_2_pv/op_push_open_pv*100,2),'%'),0) as `运营push二跳率=2跳人次/拉起人次`
,NVL(CONCAT(ROUND(AI_push_open_uv/is_open_uv*100,2),'%'),0) as `AI push拉起设备/push开启设备数`
,NVL(CONCAT(ROUND(AI_push_open_pv/is_open_uv*100,2),'%'),0) as `AI push拉起人次/push开启设备数`
,NVL(CONCAT(ROUND(AI_push_open_2_uv/is_open_uv*100,2),'%'),0) as `AI push拉起有2跳设备/push开启设备数`
,NVL(CONCAT(ROUND(AI_push_open_2_pv/is_open_uv*100,2),'%'),0) as `AI push拉起有2跳人次/push开启设备数`
,NVL(CONCAT(ROUND(AI_push_open_2_pv/AI_push_open_pv*100,2),'%'),0) as `AIpush二跳率=2跳人次/拉起人次`
,NVL(CONCAT(ROUND(ctr_push_open_uv/is_open_uv*100,2),'%'),0) as `ctr push拉起设备/push开启设备数`
,NVL(CONCAT(ROUND(ctr_push_open_pv/is_open_uv*100,2),'%'),0) as `ctr push拉起人次/push开启设备数`
,NVL(CONCAT(ROUND(ctr_push_open_2_uv/is_open_uv*100,2),'%'),0) as `ctr push拉起有2跳设备/push开启设备数`
,NVL(CONCAT(ROUND(ctr_push_open_2_pv/is_open_uv*100,2),'%'),0) as `ctr push拉起有2跳人次/push开启设备数`
,NVL(CONCAT(ROUND(ctr_push_open_2_pv/ctr_push_open_pv*100,2),'%'),0) as `ctr push二跳率=2跳人次/拉起人次`
,NVL(CONCAT(ROUND(non_ctr_push_open_uv/is_open_uv*100,2),'%'),0) as `非ctr push拉起设备/push开启设备数`
,NVL(CONCAT(ROUND(non_ctr_push_open_pv/is_open_uv*100,2),'%'),0) as `非ctr push拉起人次/push开启设备数`
,NVL(CONCAT(ROUND(non_ctr_push_open_2_uv/is_open_uv*100,2),'%'),0) as `非ctr push拉起有2跳设备/push开启设备数`
,NVL(CONCAT(ROUND(non_ctr_push_open_2_pv/is_open_uv*100,2),'%'),0) as `非ctr push拉起有2跳人次/push开启设备数`
,NVL(CONCAT(ROUND(non_ctr_push_open_2_pv/non_ctr_push_open_pv*100,2),'%'),0) as `非ctr push二跳率=2跳人次/拉起人次`
from pm.tl_pm_push_click_d
where partition_day>='20200708' and partition_day<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and day_id>='20200626'
order by `日期`,`设备类型`,`活跃类型`
select day_id as `日期`
,device_os_type as `设备类型`
,active_type as `活跃类型`
,NVL(CONCAT(ROUND(sum(case when push_type = '101' then click_dev_num end)/sum(case when push_type = '101' then received_dev_num end)*100,2),'%'),0) as `ctr帖子点击率`
,NVL(CONCAT(ROUND(sum(case when push_type = '102' then click_dev_num end)/sum(case when push_type = '102' then received_dev_num end)*100,2),'%'),0) as `ctr日记点击率`
,NVL(CONCAT(ROUND(sum(case when push_type = '103' then click_dev_num end)/sum(case when push_type = '103' then received_dev_num end)*100,2),'%'),0) as `ctr回答点击率`
,NVL(CONCAT(ROUND(sum(case when push_type = '111' then click_dev_num end)/sum(case when push_type = '111' then received_dev_num end)*100,2),'%'),0) as `非ctr帖子点击率`
,NVL(CONCAT(ROUND(sum(case when push_type = '112' then click_dev_num end)/sum(case when push_type = '112' then received_dev_num end)*100,2),'%'),0) as `非ctr日记点击率`
,NVL(CONCAT(ROUND(sum(case when push_type = '113' then click_dev_num end)/sum(case when push_type = '113' then received_dev_num end)*100,2),'%'),0) as `非ctr回答点击率`
,NVL(ROUND(sum(case when push_type = '101' then received_dev_num end)/sum(case when push_type = '111' then received_dev_num end),2),0) as `ctr帖子接收设备数/非ctr帖子接收设备数`
,NVL(ROUND(sum(case when push_type = '102' then received_dev_num end)/sum(case when push_type = '112' then received_dev_num end),2),0) as `ctr日记接收设备数/非ctr日记接收设备数`
,NVL(ROUND(sum(case when push_type = '103' then received_dev_num end)/sum(case when push_type = '113' then received_dev_num end),2),0) as `ctr回答接收设备数/非ctr回答接收设备数`
,NVL(sum(case when push_type = '101' then received_dev_num end),0) as `ctr帖子接收设备数`
,NVL(sum(case when push_type = '102' then received_dev_num end),0) as `ctr日记接收设备数`
,NVL(sum(case when push_type = '103' then received_dev_num end),0) as `ctr回答接收设备数`
,NVL(sum(case when push_type = '111' then received_dev_num end),0) as `非ctr帖子接收设备数`
,NVL(sum(case when push_type = '112' then received_dev_num end),0) as `非ctr日记接收设备数`
,NVL(sum(case when push_type = '113' then received_dev_num end),0) as `非ctr回答接收设备数`
from pm.tl_pm_push_receive_d
where partition_day>='20200708' and partition_day<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and day_id>='20200626'
group by day_id
,device_os_type
,active_type
order by `日期`,`设备类型`,`活跃类型`
\ No newline at end of file
......@@ -8,8 +8,6 @@ SET mapred.reduce.tasks=20;
SET role admin;
ADD JAR hdfs:///user/hive/share/lib/udf/hive-udf-1.0-SNAPSHOT.jar;
CREATE TEMPORARY FUNCTION convup AS 'com.gmei.hive.common.udf.UDFConvUpgrade';
INSERT OVERWRITE TABLE pm.tl_pm_recommend_strategy_d PARTITION (PARTITION_DAY = ${partition_day})
SELECT
......@@ -37,8 +35,7 @@ FROM
WHEN active_type IN ('1','2') THEN '新增' END AS active_type
,device_id
FROM online.ml_device_day_active_status
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND active_type IN ('1','2','4')
AND first_channel_source_type not IN ('yqxiu1','yqxiu2','yqxiu3','yqxiu4','yqxiu5','mxyc1','mxyc2','mxyc3'
,'wanpu','jinshan','jx','maimai','zhuoyi','huatian','suopingjingling','mocha','mizhe','meika','lamabang'
......@@ -67,17 +64,17 @@ FROM
WHEN transaction_type in ('-1','smr') THEN 'smr'
when transaction_type in ('pgc','hotspot') then '热点卡片'
when transaction_type in ('newdata') then '保量卡片'
when transaction_type in ('samecity_ctr') then 'samecity_ctr'
END AS recommend_type,
card_id,
app_session_id
from online.ml_community_precise_exposure_detail
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND action in ('page_precise_exposure','home_choiceness_card_exposure') --7745版本action改为page_precise_exposure
AND is_exposure = '1' ----精准曝光
AND page_name ='home'
AND tab_name = '精选'
AND transaction_type in ('-1','ctr','smr','cvr','hotspot','pgc','newdata')
AND transaction_type in ('-1','ctr','smr','cvr','hotspot','pgc','newdata','samecity_ctr')
AND card_content_type in ('qa','diary','user_post','answer')
group by partition_date,
case when card_content_type in ('qa','answer') then 'qa' else card_content_type end,
......@@ -86,7 +83,8 @@ FROM
WHEN transaction_type in ('cvr') THEN 'cvr预估'
WHEN transaction_type in ('-1','smr') THEN 'smr'
when transaction_type in ('pgc','hotspot') then '热点卡片'
when transaction_type in ('newdata') then '保量卡片' END,
when transaction_type in ('newdata') then '保量卡片'
when transaction_type in ('samecity_ctr') then 'samecity_ctr' END,
card_id,
app_session_id
)a
......@@ -111,16 +109,16 @@ FROM
WHEN params['transaction_type'] in ('-1','smr') THEN 'smr'
when params['transaction_type'] in ('pgc','hotspot') then '热点卡片'
when params['transaction_type'] in ('newdata') then '保量卡片'
when params['transaction_type'] in ('samecity_ctr') then 'samecity_ctr'
END AS recommend_type,
params['card_id'] as card_id,
app_session_id
from online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND action='on_click_card'
AND params['page_name'] ='home'
AND params['tab_name'] = '精选'
AND params['transaction_type'] in ('-1','ctr','smr','cvr','hotspot','pgc','newdata')
AND params['transaction_type'] in ('-1','ctr','smr','cvr','hotspot','pgc','newdata','samecity_ctr')
AND params['card_content_type'] in ('qa','diary','user_post','answer')
GROUP BY partition_date,
cl_id,
......@@ -129,7 +127,8 @@ FROM
WHEN params['transaction_type'] in ('cvr') THEN 'cvr预估'
WHEN params['transaction_type'] in ('-1','smr') THEN 'smr'
when params['transaction_type'] in ('pgc','hotspot') then '热点卡片'
when params['transaction_type'] in ('newdata') then '保量卡片' END,
when params['transaction_type'] in ('newdata') then '保量卡片'
when params['transaction_type'] in ('samecity_ctr') then 'samecity_ctr' END,
params['card_id'],
app_session_id
)a
......@@ -148,8 +147,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
sum(page_stay) as page_stay
FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND action='page_view'
AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail')
AND referrer='home'
......@@ -171,8 +169,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
count(1) as navbar_pv
FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND action in ('on_click_navbar_search','do_search')
AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail')
AND (referrer='home' or
......@@ -195,8 +192,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
count(1) as highlight_pv
FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND action='on_click_card'
and params['card_type']='highlight_word'
AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail')
......@@ -223,8 +219,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
count(1) as pv
FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND (get_json_object(params['extra_param'], '$.type')='交互栏'
or get_json_object(params['extra_param'], '$.jump_from')='msg_link'
or params['in_page_pos']='top' or params['in_page_pos']='bottom')
......@@ -256,8 +251,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
count(1) as service_pv
FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND (action='on_click_card'and params['card_content_type']='service'
or action='on_click_button' and params['button_name']='unfold')
AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail')
......@@ -286,8 +280,7 @@ FROM
when page_name in ('question_detail','answer_detail','question_answer_detail') then 'qa' else null end as page_name,
count(1) as service_pv
FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND action='on_click_card'
and params['card_content_type'] in ('qa','diary','user_post','answer')
AND page_name IN ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail')
......@@ -325,8 +318,7 @@ FROM
SELECT user_id,partition_date,
if(size(device_list) > 0, device_list [ 0 ], '') AS device_id
FROM online.ml_user_updates
WHERE partition_date>=regexp_replace(DATE_SUB(current_date,1) ,'-','')
AND partition_date<regexp_replace((current_date),'-','')
WHERE partition_date=regexp_replace(DATE_SUB(current_date,1) ,'-','')
)t1
JOIN
( --医生账号
......
#step3.job
type=command
dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/daily_recommend_strategy/liudi@igengmei.com,wangxin@igengmei.com,liweirui@igengmei.com,duanyingrong@igengmei.com,xuepengfei@igengmei.com,dengguangyu@igengmei.com,zhaowei@igengmei.com,songke@igengmei.com/zhaofei@igengmei.com,yindanlei@igengmei.com,weiyimin@igengmei.com,zhaojianwei@igengmei.com
\ No newline at end of file
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive pm tl_pm_recommend_strategy_d
\ No newline at end of file
#step4.job
type=command
dependencies=step3
command=curl -X GET http://localhost:8553/api/report/email/daily_recommend_strategy/liudi@igengmei.com,wangxin@igengmei.com,liweirui@igengmei.com,duanyingrong@igengmei.com,xuepengfei@igengmei.com,dengguangyu@igengmei.com,zhaowei@igengmei.com,songke@igengmei.com/zhaofei@igengmei.com,yindanlei@igengmei.com,weiyimin@igengmei.com
\ No newline at end of file
......@@ -4,9 +4,9 @@ SELECT
active_type as `活跃类型`,
card_content_type as `卡片类型`,
recommend_type as `推荐类型`,
NVL(CONCAT(ROUND((navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card/2)/card_exposure*100,2),'%'),0) as `来自首页推荐内容卡片的的有效二跳pv/首页卡片精准曝光PV`,
NVL(CONCAT(ROUND((navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card*0.2)/card_exposure*100,2),'%'),0) as `来自首页推荐内容卡片的的有效二跳pv/首页卡片精准曝光PV`,
NVL(CONCAT(ROUND(card_click/card_exposure*100,2),'%'),0) as `首页卡片点击PV/首页卡片精准曝光PV`,
NVL(CONCAT(ROUND((navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card/2)/card_click*100,2),'%'),0) as `来自首页推荐内容卡片的的有效二跳pv/首页卡片点击PV`,
NVL(CONCAT(ROUND((navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card*0.2)/card_click*100,2),'%'),0) as `来自首页推荐内容卡片的的有效二跳pv/首页卡片点击PV`,
card_click as `首页卡片点击PV`,
card_exposure as `首页卡片精准曝光PV`,
(navbar_search+highlight_word+self_welfare_card+recommend_welfare_card+recommend_content_card/2)as `有效二跳pv`,
......
#step2.job
type=command
dependencies=step1_1,step1_2,step1_3
command=curl -X GET http://localhost:8553/api/report/email/meigou_detail_page/liudi@igengmei.com,wangxin@igengmei.com,zhaofei@igengmei.com/weiyimin@igengmei.com,yindanlei@igengmei.com,zhaojianwei@igengmei.com
\ No newline at end of file
command=curl -X GET http://localhost:8553/api/report/email/meigou_detail_page/liudi@igengmei.com,wangxin@igengmei.com,zhaofei@igengmei.com/weiyimin@igengmei.com,yindanlei@igengmei.com
\ No newline at end of file
......@@ -40,20 +40,20 @@ FROM
,t1.device_type as `设备类型`
,t1.active_type as `活跃类型`
,t2.channel as `渠道`
,count(case when type='美购详情页' then cl_id end ) as `美购详情页浏览uv`
,count(case when type='加购物车' then cl_id end ) as `加购物车点击uv`
,count(case when type='评价列表页' then cl_id end ) as `评价列表页点击uv`
,count(case when type='立即支付' then cl_id end ) as `立即支付点击uv`
,count(case when type='私信及电话咨询' then cl_id end ) as `私信及电话咨询uv`
,count(case when type='选择美购项目' then cl_id end ) as `选择美购项目点击uv`
,count(case when type='机构主页' then cl_id end ) as `机构主页点击uv`
,count(case when type='机构的其他美购' then cl_id end ) as `机构的其他美购点击uv`
,count(case when type='推荐美购' then cl_id end ) as `推荐美购点击uv`
,count(case when type='收藏' then cl_id end ) as `收藏点击uv`
,count(case when type='右上角购物车' then cl_id end ) as `右上角购物车点击uv`
,count(case when type='医生主页' then cl_id end ) as `医生主页点击uv`
,count(case when type='分享' then cl_id end ) as `分享点击uv`
,count(case when type='机构导航' then cl_id end ) as `机构导航点击uv`
,count(distinct case when type='美购详情页' then cl_id end ) as `美购详情页浏览uv`
,count(distinct case when type='加购物车' then cl_id end ) as `加购物车点击uv`
,count(distinct case when type='评价列表页' then cl_id end ) as `评价列表页点击uv`
,count(distinct case when type='立即支付' then cl_id end ) as `立即支付点击uv`
,count(distinct case when type='私信及电话咨询' then cl_id end ) as `私信及电话咨询uv`
,count(distinct case when type='选择美购项目' then cl_id end ) as `选择美购项目点击uv`
,count(distinct case when type='机构主页' then cl_id end ) as `机构主页点击uv`
,count(distinct case when type='机构的其他美购' then cl_id end ) as `机构的其他美购点击uv`
,count(distinct case when type='推荐美购' then cl_id end ) as `推荐美购点击uv`
,count(distinct case when type='收藏' then cl_id end ) as `收藏点击uv`
,count(distinct case when type='右上角购物车' then cl_id end ) as `右上角购物车点击uv`
,count(distinct case when type='医生主页' then cl_id end ) as `医生主页点击uv`
,count(distinct case when type='分享' then cl_id end ) as `分享点击uv`
,count(distinct case when type='机构导航' then cl_id end ) as `机构导航点击uv`
FROM
(
......
#step3.job
type=command
dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/search_related/liudi@igengmei.com,wangxin@igengmei.com,malinxi@igengmei.com,duanyingrong@igengmei.com,dengguangyu@igengmei.com/zhaofei@igengmei.com,yindanlei@igengmei.com,weiyimin@igengmei.com,zhaojianwei@igengmei.com
\ No newline at end of file
#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_1,step3_2,step3_3
command=curl -X GET http://localhost:8553/api/report/email/search_related/liudi@igengmei.com,wangxin@igengmei.com,duanyingrong@igengmei.com,dengguangyu@igengmei.com/zhaofei@igengmei.com,yindanlei@igengmei.com,weiyimin@igengmei.com
\ 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