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

push codes

parent 0ae05863
--***************************************************************
--*脚本名称:
--*功能: push质量数据
--*业务名称: pm
--*输入数据:
--*作者: weiyimin@igengmei.com
--*更新时间:
--***************************************************************
--设置全局变量&UDF
SET mapreduce.job.queuename=data;
--使用bl数据库
USE pm;
--创建BL层内部表
CREATE TABLE IF NOT EXISTS pm.tl_pm_push_quality_d
(
day_id string comment '{"chs_name":"当天日期","description":"","etl":"","value":"","remark":""}',
device_os_type string comment '{"chs_name":"设备类型","description":"","etl":"","value":"","remark":""}',
op_only_wel double comment '{"chs_name":"只通过运营push来-漏到核心页","description":"","etl":"","value":"","remark":""}',
op_push_first_wel double comment '{"chs_name":"先通过运营push来-漏到核心页","description":"","etl":"","value":"","remark":""}',
op_open_first_wel double comment '{"chs_name":"先主动打开再运营push-漏到核心页","description":"","etl":"","value":"","remark":""}',
op_only_clue double comment '{"chs_name":"只通过运营push来-漏到线索","description":"","etl":"","value":"","remark":""}',
op_push_first_clue double comment '{"chs_name":"先通过运营push来-漏到线索","description":"","etl":"","value":"","remark":""}',
op_open_first_clue double comment '{"chs_name":"先主动打开再运营push-漏到线索","description":"","etl":"","value":"","remark":""}',
auto_only_wel double comment '{"chs_name":"只通过自动化push来-漏到核心页","description":"","etl":"","value":"","remark":""}',
auto_push_first_wel double comment '{"chs_name":"先通过自动化push来-漏到核心页","description":"","etl":"","value":"","remark":""}',
auto_open_first_wel double comment '{"chs_name":"先主动打开再自动化push-漏到核心页","description":"","etl":"","value":"","remark":""}',
auto_only_clue double comment '{"chs_name":"只通过自动化push来-漏到线索","description":"","etl":"","value":"","remark":""}',
auto_push_first_clue double comment '{"chs_name":"先通过自动化push来-漏到线索","description":"","etl":"","value":"","remark":""}',
auto_open_first_clue double 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
......@@ -560,4 +560,338 @@ and t2.msg_id=t1.msg_id
and t2.cl_id=t1.device_id
group by t1.partition_day
,t1.device_os_type
,t1.push_type;
\ No newline at end of file
,t1.push_type;
--push质量数据
SELECT partition_date as day_id
,device_os_type
,round(nvl((op_only_wel_pv/op_only_wel_uv)/(wel_pv/wel_uv),0),2) as op_only_wel
,round(nvl((op_push_first_wel_pv/op_push_first_wel_uv)/(wel_pv/wel_uv),0),2) as op_push_first_wel
,round(nvl((op_open_first_wel_pv/op_open_first_wel_uv)/(wel_pv/wel_uv),0),2) as op_open_first_wel
,round(nvl((op_only_clue_pv/op_only_clue_uv)/(clue_pv/clue_uv),0),2) as op_only_clue
,round(nvl((op_push_first_clue_pv/op_push_first_clue_uv)/(clue_pv/clue_uv),0),2) as op_push_first_clue
,round(nvl((op_open_first_clue_pv/op_open_first_clue_uv)/(clue_pv/clue_uv),0),2) as op_open_first_clue
,round(nvl((auto_only_wel_pv/auto_only_wel_uv)/(wel_pv/wel_uv),0),2) as auto_only_wel
,round(nvl((auto_push_first_wel_pv/auto_push_first_wel_uv)/(wel_pv/wel_uv),0),2) as auto_push_first_wel
,round(nvl((auto_open_first_wel_pv/auto_open_first_wel_uv)/(wel_pv/wel_uv),0),2) as auto_open_first_wel
,round(nvl((auto_only_clue_pv/auto_only_clue_uv)/(clue_pv/clue_uv),0),2) as auto_only_clue
,round(nvl((auto_push_first_clue_pv/auto_push_first_clue_uv)/(clue_pv/clue_uv),0),2) as auto_push_first_clue
,round(nvl((auto_open_first_clue_pv/auto_open_first_clue_uv)/(clue_pv/clue_uv),0),2) as auto_open_first_clue
FROM
(
SELECT mas.partition_date
,device_os_type
,count(distinct a.cl_id) as wel_uv
,sum(a.wel_pv) as wel_pv
,count(distinct b.device_id) as clue_uv
,sum(b.valid_pv) as clue_pv
,count(distinct case when c.push_type='运营push' and d.type='仅点击push' then a.cl_id end) as op_only_wel_uv
,sum(case when c.push_type='运营push' and d.type='仅点击push' then a.wel_pv end) as op_only_wel_pv
,count(distinct case when c.push_type='运营push' and d.type='仅点击push' then b.device_id end) as op_only_clue_uv
,sum(case when c.push_type='运营push' and d.type='仅点击push' then b.valid_pv end) as op_only_clue_pv
,count(distinct case when c.push_type='自动化push' and d.type='仅点击push' then a.cl_id end) as auto_only_wel_uv
,sum(case when c.push_type='自动化push' and d.type='仅点击push' then a.wel_pv end) as auto_only_wel_pv
,count(distinct case when c.push_type='自动化push' and d.type='仅点击push' then b.device_id end) as auto_only_clue_uv
,sum(case when c.push_type='自动化push' and d.type='仅点击push' then b.valid_pv end) as auto_only_clue_pv
,count(distinct case when c.push_type='运营push' and d.type='先通过push来后主动打开' then a.cl_id end) as op_push_first_wel_uv
,sum(case when c.push_type='运营push' and d.type='先通过push来后主动打开' then a.wel_pv end) as op_push_first_wel_pv
,count(distinct case when c.push_type='运营push' and d.type='先通过push来后主动打开' then b.device_id end) as op_push_first_clue_uv
,sum(case when c.push_type='运营push' and d.type='先通过push来后主动打开' then b.valid_pv end) as op_push_first_clue_pv
,count(distinct case when c.push_type='自动化push' and d.type='先通过push来后主动打开' then a.cl_id end) as auto_push_first_wel_uv
,sum(case when c.push_type='自动化push' and d.type='先通过push来后主动打开' then a.wel_pv end) as auto_push_first_wel_pv
,count(distinct case when c.push_type='自动化push' and d.type='先通过push来后主动打开' then b.device_id end) as auto_push_first_clue_uv
,sum(case when c.push_type='自动化push' and d.type='先通过push来后主动打开' then b.valid_pv end) as auto_push_first_clue_pv
,count(distinct case when c.push_type='运营push' and d.type='先主动打开后通过push来' then a.cl_id end) as op_open_first_wel_uv
,sum(case when c.push_type='运营push' and d.type='先主动打开后通过push来' then a.wel_pv end) as op_open_first_wel_pv
,count(distinct case when c.push_type='运营push' and d.type='先主动打开后通过push来' then b.device_id end) as op_open_first_clue_uv
,sum(case when c.push_type='运营push' and d.type='先主动打开后通过push来' then b.valid_pv end) as op_open_first_clue_pv
,count(distinct case when c.push_type='自动化push' and d.type='先主动打开后通过push来' then a.cl_id end) as auto_open_first_wel_uv
,sum(case when c.push_type='自动化push' and d.type='先主动打开后通过push来' then a.wel_pv end) as auto_open_first_wel_pv
,count(distinct case when c.push_type='自动化push' and d.type='先主动打开后通过push来' then b.device_id end) as auto_open_first_clue_uv
,sum(case when c.push_type='自动化push' and d.type='先主动打开后通过push来' then b.valid_pv end) as auto_open_first_clue_pv
FROM
(
SELECT partition_date
,device_os_type
,device_id
FROM online.ml_device_day_active_status
WHERE partition_date>=REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
AND partition_date<=regexp_replace(date_sub(current_date,1),'-','')
AND active_type IN ('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'
,'js-az1','js-az2','js-az3','js-az4','js-az5','jfq-az1','jfq-az2','jfq-az3','jfq-az4','jfq-az5','toufang1'
,'toufang2','toufang3','toufang4','toufang5','toufang6','TF-toufang1','TF-toufang2','TF-toufang3','TF-toufang4'
,'TF-toufang5','tf-toufang1','tf-toufang2','tf-toufang3','tf-toufang4','tf-toufang5','benzhan','promotion_aso100'
,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ'
,'promotion_shike','promotion_julang_jl03','promotion_zuimei')
AND first_channel_source_type not LIKE 'promotion\_jf\_%'
)mas
LEFT JOIN
(
SELECT partition_date,cl_id,wel_pv
FROM
(
SELECT partition_date,cl_id,count(1) as wel_pv
FROM online.bl_hdfs_maidian_updates
WHERE partition_date>=REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
AND partition_date<=regexp_replace(date_sub(current_date,1),'-','')
AND action = 'page_view'
AND page_name in ('welfare_detail','organization_detail','expert_detail')
GROUP BY partition_date,cl_id
)a
LEFT JOIN
( -- 去掉疑似机构刷量的PV和UV
select distinct device_id
from ml.ml_d_ct_dv_devicespam_d
where partition_day=regexp_replace(date_sub(current_date,1),'-','')
)spam_pv
on a.cl_id=spam_pv.device_id
WHERE spam_pv.device_id IS NULL
)a
on a.partition_date=mas.partition_date and a.cl_id=mas.device_id
LEFT JOIN
( --有效线索分日数据(按用户维度)
SELECT
t2.device_id,DATE_DAY,count(1) AS valid_pv
FROM
(
SELECT NVL(T1.USER_ID,T2.USER_ID) AS USER_ID,
NVL(T1.merchant_id,T2.merchant_id) AS merchant_id,
NVL(T1.DATE_MONTH,T2.CALL_MONTH) AS DATE_MONTH,
least(NVL(DATE_DAY,'99999999'),NVL(FIRST_CALL_DATE,'99999999')) AS DATE_DAY,
NVL(T1.CONSULT_NUM,0) AS CONSULT_NUM,
NVL(T1.PAY_NUM,0) AS PAY_NUM,
NVL(T2.call_num,0) AS CALL_NUM
FROM
(
SELECT
NVL(T3.USER_ID,T4.USER_ID) AS USER_ID,
NVL(T3.merchant_id,T4.merchant_id) AS merchant_id,
NVL(T3.CONSULT_MONTH,T4.PAY_MONTH) AS DATE_MONTH,
least(NVL(first_consult_date,'99999999'),NVL(FIRST_PAY_DATE,'99999999')) AS DATE_DAY,
NVL(T3.CONSULT_NUM,0) AS CONSULT_NUM,
NVL(T4.PAY_NUM,0) AS PAY_NUM
FROM
(
SELECT user_id,merchant_id,SUBSTR(partition_day,1,6) AS consult_month,min(partition_day) as first_consult_date,1 as CONSULT_NUM
FROM ml.ml_c_et_msg_conversation_dimen_inc_d --新仓库私信表
WHERE partition_day >= REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
AND partition_day <= regexp_replace(date_sub(current_date,1),'-','')
and is_valid='true'
GROUP BY user_id,merchant_id,SUBSTR(partition_day,1,6)
)T3
FULL JOIN
(
SELECT
T.USER_ID,
T.merchant_id,
regexp_replace(SUBSTR(T.PAY_DATE,1,7),'-','') AS PAY_MONTH,
MIN(regexp_replace(SUBSTR(T.PAY_DATE,1,10),'-','')) AS FIRST_PAY_DATE,
1 AS PAY_NUM
FROM ONLINE.ML_TRADE_ORDER_DETAIL_DAY T
WHERE
T.PARTITION_DATE = regexp_replace(date_sub(current_date(),1),'-','')
AND regexp_replace(SUBSTR(T.pay_date,1,10),'-','') >= REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
AND regexp_replace(SUBSTR(T.pay_date,1,10),'-','')<=regexp_replace(date_sub(current_date,1),'-','')
AND T.is_pure_user='true'
GROUP BY T.USER_ID,T.merchant_id,regexp_replace(SUBSTR(T.PAY_DATE,1,7),'-','')
) T4
ON T3.USER_ID = T4.USER_ID AND T3.merchant_id = T4.merchant_id AND T3.CONSULT_MONTH = T4.PAY_MONTH
GROUP BY NVL(T3.USER_ID,T4.USER_ID),NVL(T3.merchant_id,T4.merchant_id),NVL(T3.CONSULT_MONTH,T4.PAY_MONTH),
least(NVL(first_consult_date,'99999999'),NVL(FIRST_PAY_DATE,'99999999')),NVL(T3.CONSULT_NUM,0),NVL(T4.PAY_NUM,0)
)T1
FULL JOIN
(
SELECT user_id,merchant_id,regexp_replace(SUBSTR(a.partition_date,1,6),'-','') AS CALL_MONTH,
MIN(partition_date) as FIRST_CALL_DATE,1 AS call_num
FROM
(
SELECT sub_id,REGEXP_REPLACE(SUBSTR(call_time,0,10), '-', '') as partition_date
FROM tl.tl_gm_sl_ali_virtual_phone_call_detail --通话记录表,call_type呼叫类型
WHERE partition_day=regexp_replace(date_sub(current_date(),1),'-','')
AND REGEXP_REPLACE(SUBSTR(call_time,0,10), '-', '')>=REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
AND REGEXP_REPLACE(SUBSTR(call_time,0,10), '-', '')<=regexp_replace(date_sub(current_date,1),'-','')
AND start_time<release_time --通话时长大于30秒
)a
LEFT JOIN
(
SELECT id,sub_id
FROM tl.tl_gm_sl_ali_virtual_phone_binding --阿里记录表
WHERE partition_day=regexp_replace(date_sub(current_date(),1),'-','')
)b
ON a.sub_id = b.sub_id
LEFT JOIN
(
SELECT id,platform_binding_id
FROM tl.tl_gm_sl_virtual_phone_binding
WHERE partition_day=regexp_replace(date_sub(current_date(),1),'-','')
)c
ON b.id = c.platform_binding_id
LEFT JOIN
(
SELECT phone_binding_id,lead_task_id
FROM tl.tl_gm_sl_lead_task_phone_binding
WHERE partition_day=regexp_replace(date_sub(current_date(),1),'-','')
)d
ON c.id = d.phone_binding_id
JOIN
(
SELECT id,user_id,merchant_id
FROM tl.tl_gm_sl_lead_task --线索任务表(用户点击授权后记入该表)
WHERE partition_day=regexp_replace(date_sub(current_date(),1),'-','')
AND source='2' --用户行为电话授权
)e
ON d.lead_task_id = e.id
GROUP BY user_id,merchant_id,regexp_replace(SUBSTR(a.partition_date,1,6),'-','')
)T2
ON T1.USER_ID = T2.USER_ID AND T1.merchant_id = T2.merchant_id AND T1.DATE_MONTH = T2.CALL_MONTH
)t1
JOIN
(
SELECT t.user_id,partition_date,if(size(t.device_list) > 0, device_list [ 0 ], '') device_id
FROM online.ml_user_updates t
WHERE t.partition_date >= REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
and t.partition_date <= regexp_replace(date_sub(current_date(),1),'-','')
)t2
on t1.user_id=t2.user_id and t1.DATE_DAY=t2.partition_date
GROUP BY t2.device_id,date_day
)b
ON b.date_day=mas.partition_date and b.device_id=mas.device_id
LEFT JOIN
(
SELECT a.partition_date,a.cl_id,
case when push_type in ('70','71') then '运营push'
when push_type not in ('70','71') and push_type is not null then '自动化push' end as push_type
FROM
(
SELECT a.partition_date,b.cl_id,b.message_id
FROM
(
--设备开启
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,app_session_id
FROM online.bl_hdfs_maidian_updates
WHERE partition_date >= REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
and partition_date <= regexp_replace(date_sub(current_date(),1),'-','')
and action='device_opened'
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),app_session_id
)a
JOIN
(
--推送点击
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,params['message_id'] as message_id
FROM online.bl_hdfs_maidian_updates
WHERE partition_date >= REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
and partition_date <= regexp_replace(date_sub(current_date(),1),'-','')
and action='notification_open'
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),params['message_id']
)b
on a.partition_date = b.partition_date
AND a.cl_id = b.cl_id
where abs(a.time_stamp-b.time_stamp)<=2
)a
LEFT join
(
select msg_id,push_type,time_stamp
from online.tl_hdfs_push2_new_view --增量表
where partition_date>=REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
AND partition_date<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
group by msg_id,push_type,time_stamp
)b
on a.message_id=b.msg_id
group by a.partition_date,a.cl_id,
case when push_type in ('70','71') then '运营push'
when push_type not in ('70','71') and push_type is not null then '自动化push' end
)c
on c.cl_id=mas.device_id and c.partition_date=mas.partition_date
LEFT JOIN
(
SELECT t1.partition_date,t1.cl_id
,case when array_contains(t1.type,"点击push")=TRUE and size(t1.type)=1 then '仅点击push'
when array_contains(t1.type,"打开设备")=TRUE and size(t1.type)=1 then '仅打开设备'
when t2.type='首次push拉起' then '先通过push来后主动打开'
when t2.type ='首次非push拉起' then '先主动打开后通过push来' else null end as type
FROM
(
SELECT partition_date,cl_id,collect_set(type) as type
FROM
(
SELECT a.partition_date,a.cl_id
,case when abs(a.time_stamp-b.time_stamp)<=2 then '点击push'
else '打开设备' end as type
FROM
(
--设备开启
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp
FROM online.bl_hdfs_maidian_updates
WHERE partition_date >= REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
and partition_date <= regexp_replace(date_sub(current_date(),1),'-','')
and action='device_opened'
and REGEXP_REPLACE(SUBSTR(time_str, 1, 10), '-', '')=partition_date
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19))
)a
left JOIN
(
--推送点击
SELECT partition_date,cl_id,unix_timestamp(substr(time_str,1,19)) as time_stamp,params['message_id'] as message_id
FROM online.bl_hdfs_maidian_updates
WHERE partition_date >= REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
and partition_date <= regexp_replace(date_sub(current_date(),1),'-','')
and action='notification_open'
and REGEXP_REPLACE(SUBSTR(time_str, 1, 10), '-', '')=partition_date
group by partition_date,cl_id,unix_timestamp(substr(time_str,1,19)),params['message_id']
)b
on a.partition_date = b.partition_date
AND a.cl_id = b.cl_id
group by a.partition_date,a.cl_id,case when abs(a.time_stamp-b.time_stamp)<=2 then '点击push'else '打开设备' end
)a
group by partition_date,cl_id
)t1
left join
(
SELECT a.partition_date,a.cl_id,
case when abs(a.time_stamp-b.time_stamp)<=2 then '首次push拉起' else '首次非push拉起' end as type
FROM
(
--设备开启
SELECT partition_date,cl_id,min(unix_timestamp(substr(time_str,1,19))) as time_stamp
FROM online.bl_hdfs_maidian_updates
WHERE partition_date >= REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
and partition_date <= regexp_replace(date_sub(current_date(),1),'-','')
and action='device_opened'
and REGEXP_REPLACE(SUBSTR(time_str, 1, 10), '-', '')=partition_date
group by partition_date,cl_id
)a
left JOIN
(
--推送点击
SELECT partition_date,cl_id,min(unix_timestamp(substr(time_str,1,19))) as time_stamp
FROM online.bl_hdfs_maidian_updates
WHERE partition_date >= REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','')
and partition_date <= regexp_replace(date_sub(current_date(),1),'-','')
and action='notification_open'
and REGEXP_REPLACE(SUBSTR(time_str, 1, 10), '-', '')=partition_date
group by partition_date,cl_id
)b
on a.partition_date=b.partition_date and a.cl_id=b.cl_id
)t2
on t1.partition_date=t2.partition_date and t1.cl_id=t2.cl_id
)d
on c.cl_id=d.cl_id and c.partition_date=d.partition_date
group by mas.partition_date
,device_os_type
)t;
#step1_9.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive ml ml_c_et_msg_conversation_dimen_inc_d
\ No newline at end of file
#step1_9.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ML_TRADE_ORDER_DETAIL_DAY
\ No newline at end of file
#step1_9.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive tl tl_gm_sl_ali_virtual_phone_call_detail
\ No newline at end of file
#step1_9.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive tl tl_gm_sl_ali_virtual_phone_binding
\ No newline at end of file
#step1_9.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive tl tl_gm_sl_virtual_phone_binding
\ No newline at end of file
#step1_9.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive tl tl_gm_sl_lead_task_phone_binding
\ No newline at end of file
#step1_9.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive tl tl_gm_sl_lead_task
\ No newline at end of file
#step1_9.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_user_updates
\ 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,step1_8,step1_9
dependencies=step1_1,step1_2,step1_3,step1_4,step1_5,step1_6,step1_7,step1_8,step1_9,step1_10,step1_11,step1_12,step1_13,step1_14,step1_15,step1_16,step1_17
command=sh /home/bi/bi-report/lib/shell/hive daily_push
\ No newline at end of file
#step3.job
type=command
dependencies=step2
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,weiyimin@igengmei.com
\ No newline at end of file
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,weiyimin@igengmei.com,yindanlei@igengmei.com,wangyan@igengmei.com
\ No newline at end of file
--***************************************************************
--*脚本名称:
--*功能: 首页推荐策略日报
--*业务名称: pm
--*输入数据:
--*作者: weiyimin@igengmei.com
--*更新时间:
--***************************************************************
--设置全局变量&UDF
SET mapreduce.job.queuename=data;
--使用bl数据库
USE pm;
--创建BL层内部表
CREATE TABLE IF NOT EXISTS pm.tl_pm_recommend_strategy_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":""}',
card_content_type string comment '{"chs_name":"卡片类型","description":"","etl":"","value":"","remark":""}',
recommend_type string comment '{"chs_name":"推荐类型","description":"","etl":"","value":"","remark":""}',
card_click bigint comment '{"chs_name":"","description":"","etl":"","value":"","remark":""}',
card_exposure bigint comment '{"chs_name":"","description":"","etl":"","value":"","remark":""}',
avg_page_stay double comment '{"chs_name":"","description":"","etl":"","value":"","remark":""}',
navbar_search bigint comment '{"chs_name":"","description":"","etl":"","value":"","remark":""}',
highlight_word bigint comment '{"chs_name":"","description":"","etl":"","value":"","remark":""}',
self_welfare_card bigint comment '{"chs_name":"","description":"","etl":"","value":"","remark":""}',
recommend_welfare_card bigint comment '{"chs_name":"","description":"","etl":"","value":"","remark":""}',
recommend_content_card bigint comment '{"chs_name":"","description":"","etl":"","value":"","remark":""}',
recommend_special_card bigint comment '{"chs_name":"","description":"","etl":"","value":"","remark":""}',
transfer_card bigint comment '{"chs_name":"","description":"","etl":"","value":"","remark":""}',
video_consultation bigint 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
#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/weiyimin@igengmei.com
\ No newline at end of file
command=curl -X GET http://localhost:8553/api/report/email/daily_recommend_strategy/liudi@igengmei.com,wangxin@igengmei.com,zhaoyang@igengmei.com,liweirui@igengmei.com,duanyingrong@igengmei.com,xuepengfei@igengmei.com,dengguangyu@igengmei.com,zhaowei@igengmei.com,songke@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