Commit 3d61b15d authored by 魏艺敏's avatar 魏艺敏

push codes

parent 866d4528
...@@ -453,8 +453,7 @@ FROM ...@@ -453,8 +453,7 @@ FROM
FROM online.al_business_merchant_grade_day_repo FROM online.al_business_merchant_grade_day_repo
where partition_date=regexp_replace(date_sub(current_date,1),'-','') where partition_date=regexp_replace(date_sub(current_date,1),'-','')
)a )a
where ((rn=1 and merchant_level>=4) or merchant_id in ('6329571003697540960')) where rn=1 and merchant_level>=3
and merchant_id not in ('6385685250516781117')--去除和增加是为了和王妍的线索通数据保持一致
)b )b
on msg.merchant_id=b.merchant_id on msg.merchant_id=b.merchant_id
GROUP BY msg.partition_date,user_id GROUP BY msg.partition_date,user_id
...@@ -483,8 +482,7 @@ FROM ...@@ -483,8 +482,7 @@ FROM
FROM online.al_business_merchant_grade_day_repo FROM online.al_business_merchant_grade_day_repo
where partition_date=regexp_replace(date_sub(current_date,1),'-','') where partition_date=regexp_replace(date_sub(current_date,1),'-','')
)a )a
where ((rn=1 and merchant_level>=4) or merchant_id in ('6329571003697540960')) where rn=1 and merchant_level>=3
and merchant_id not in ('6385685250516781117')--去除和增加是为了和王妍的线索通数据保持一致
)b )b
on msg.merchant_id=b.merchant_id on msg.merchant_id=b.merchant_id
GROUP BY msg.partition_date,user_id GROUP BY msg.partition_date,user_id
...@@ -512,8 +510,7 @@ FROM ...@@ -512,8 +510,7 @@ FROM
FROM online.al_business_merchant_grade_day_repo FROM online.al_business_merchant_grade_day_repo
where partition_date=regexp_replace(date_sub(current_date,1),'-','') where partition_date=regexp_replace(date_sub(current_date,1),'-','')
)a )a
where ((rn=1 and merchant_level>=4) or merchant_id in ('6329571003697540960')) where rn=1 and merchant_level>=3
and merchant_id not in ('6385685250516781117')--去除和增加是为了和王妍的线索通数据保持一致
)b )b
on a.merchant_id=b.merchant_id on a.merchant_id=b.merchant_id
GROUP BY partition_date,user_id GROUP BY partition_date,user_id
...@@ -935,7 +932,7 @@ LEFT JOIN ...@@ -935,7 +932,7 @@ LEFT JOIN
)t9 )t9
ON t3.partition_date = t9.partition_date and t3.user_id=t9.user_id ON t3.partition_date = t9.partition_date and t3.user_id=t9.user_id
LEFT JOIN LEFT JOIN
( ---拨打电话线索 ( ---有效电话线索
SELECT partition_date,user_id SELECT partition_date,user_id
,count(1) as valid_call_num ,count(1) as valid_call_num
FROM FROM
...@@ -1061,8 +1058,7 @@ LEFT JOIN ...@@ -1061,8 +1058,7 @@ LEFT JOIN
FROM online.al_business_merchant_grade_day_repo FROM online.al_business_merchant_grade_day_repo
where partition_date=regexp_replace(date_sub(current_date,1),'-','') where partition_date=regexp_replace(date_sub(current_date,1),'-','')
)a )a
where ((rn=1 and merchant_level>=4) or merchant_id in ('6329571003697540960')) where rn=1 and merchant_level>=3
and merchant_id not in ('6385685250516781117')--去除和增加是为了和王妍的线索通数据保持一致
)b )b
on t1.merchant_id=b.merchant_id on t1.merchant_id=b.merchant_id
GROUP BY user_id,partition_date GROUP BY user_id,partition_date
...@@ -1128,8 +1124,7 @@ LEFT JOIN ...@@ -1128,8 +1124,7 @@ LEFT JOIN
FROM online.al_business_merchant_grade_day_repo FROM online.al_business_merchant_grade_day_repo
where partition_date=regexp_replace(date_sub(current_date,1),'-','') where partition_date=regexp_replace(date_sub(current_date,1),'-','')
)a )a
where ((rn=1 and merchant_level>=4) or merchant_id in ('6329571003697540960')) where rn=1 and merchant_level>=3
and merchant_id not in ('6385685250516781117')--去除和增加是为了和王妍的线索通数据保持一致
)b )b
on t1.merchant_id=b.merchant_id on t1.merchant_id=b.merchant_id
GROUP BY user_id,partition_date GROUP BY user_id,partition_date
......
...@@ -15,16 +15,16 @@ SELECT day_id `日期` ...@@ -15,16 +15,16 @@ SELECT day_id `日期`
,valid_call_dev as `有效电话线索设备数-总计` ,valid_call_dev as `有效电话线索设备数-总计`
,valid_call_num as `有效电话线索人次-总计` ,valid_call_num as `有效电话线索人次-总计`
,msg_dev_4 `私信咨询设备数-4级以上商户` ,msg_dev_4 `私信咨询设备数-3级以上商户`
,msg_num_4 `私信咨询人次-4级以上商户` ,msg_num_4 `私信咨询人次-3级以上商户`
,valid_msg_dev_4 `有效私信咨询设备数-4级以上商户` ,valid_msg_dev_4 `有效私信咨询设备数-3级以上商户`
,valid_msg_num_4 as `有效私信咨询人次-4级以上商户` ,valid_msg_num_4 as `有效私信咨询人次-3级以上商户`
,clue_dev_4 as `授权电话线索设备数-4级以上商户` ,clue_dev_4 as `授权电话线索设备数-3级以上商户`
,clue_num_4 as `授权电话线索人次-4级以上商户` ,clue_num_4 as `授权电话线索人次-3级以上商户`
,call_dev_4 as `拨打电话线索设备数-4级以上商户` ,call_dev_4 as `拨打电话线索设备数-3级以上商户`
,call_num_4 as `拨打电话线索人次-4级以上商户` ,call_num_4 as `拨打电话线索人次-3级以上商户`
,valid_call_dev_4 as `有效电话线索设备数-4级以上商户` ,valid_call_dev_4 as `有效电话线索设备数-3级以上商户`
,valid_call_num_4 as `有效电话线索人次-4级以上商户` ,valid_call_num_4 as `有效电话线索人次-3级以上商户`
,msg_dev_kyc `私信咨询设备数-kyc` ,msg_dev_kyc `私信咨询设备数-kyc`
,msg_num_kyc `私信咨询人次-kyc` ,msg_num_kyc `私信咨询人次-kyc`
......
sign_daily=签到用户质量日报
\ 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_sign_deepaction_d
(
day_id string comment '{"chs_name":"当天日期","description":"","etl":"","value":"","remark":""}',
device_os_type string comment '{"chs_name":"设备类型","description":"","etl":"","value":"","remark":""}',
user_type string comment '{"chs_name":"用户类型","description":"","etl":"","value":"","remark":""}',
active_num bigint comment '{"chs_name":"活跃设备数","description":"","etl":"","value":"","remark":""}',
wel_pv bigint comment '{"chs_name":"商品核心页浏览pv","description":"","etl":"","value":"","remark":""}',
wel_uv bigint comment '{"chs_name":"商品核心页浏览uv","description":"","etl":"","value":"","remark":""}',
clue_num 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
This diff is collapsed.
#step1_1.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_3.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_3.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_3.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_13.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_user_updates
\ No newline at end of file
#step1_2.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_3.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_3.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_3.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online tl_hdfs_api_user_sign_v2_view
\ No newline at end of file
#step1_3.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_3.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online tl_hdfs_doctor_view
\ No newline at end of file
#step1_3.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_3.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
#step2.job
type=command
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
command=sh /home/bi/bi-report/lib/shell/hive clue_daily
\ No newline at end of file
#step3.job
type=command
dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/clue_daily/liudi@igengmei.com,wangxin@igengmei.com,zhaoyang@igengmei.com/weiyimin@igengmei.com
\ No newline at end of file
SELECT day_id as `日期`
,round((sum(CASE WHEN device_os_type = 'ios' AND user_type='非首日签到用户' THEN wel_pv END)/count(distinct CASE WHEN device_os_type = 'ios' and user_type='非首日签到用户' THEN mas.device_id END))/(sum(CASE WHEN device_os_type = 'ios' THEN wel_pv END)/count(distinct CASE WHEN device_os_type = 'ios' THEN mas.device_id END)),2) as `单个iOS非首日签到贡献商品核心页PV/单个iOS老贡献商品核心页PV`
,round((sum(CASE WHEN device_os_type = 'ios' AND user_type='非首日签到用户' THEN clue_num END)/count(distinct CASE WHEN device_os_type = 'ios' AND user_type='非首日签到用户' THEN mas.device_id END))/(sum(CASE WHEN device_os_type = 'ios' AND b.device_id is NOT NULL THEN b.valid_pv END)/count(distinct CASE WHEN device_os_type = 'ios' THEN mas.device_id END)),2) as `单个iOS非首日签到贡献有效线索人次/单个iOS老贡献有效线索人次`
,round((sum(CASE WHEN device_os_type = 'android' AND user_type='非首日签到用户' THEN wel_pv END)/count(distinct CASE WHEN device_os_type = 'android' and user_type='非首日签到用户' THEN mas.device_id END))/(sum(CASE WHEN device_os_type = 'android' THEN wel_pv END)/count(distinct CASE WHEN device_os_type = 'android' THEN mas.device_id END)),2) as `单个android非首日签到贡献商品核心页PV/单个android老贡献商品核心页PV`
,round((sum(CASE WHEN device_os_type = 'android' AND user_type='非首日签到用户' THEN clue_num END)/count(distinct CASE WHEN device_os_type = 'android' AND user_type='非首日签到用户' THEN mas.device_id END))/(sum(CASE WHEN device_os_type = 'android' AND b.device_id is NOT NULL THEN b.valid_pv END)/count(distinct CASE WHEN device_os_type = 'android' THEN mas.device_id END)),2) as `单个android非首日签到贡献有效线索人次/单个android老贡献有效线索人次`
FROM pm.tl_pm_sign_deepaction_d
where partition_day in ('20200901','202001001','20201101','20201201','20210101',regexp_replace(date_sub(current_date,1),'-',''))
order by `日期`,`系统`,`新老`,`是否灰度`
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