Commit 85f385cb authored by 赵建伟's avatar 赵建伟

Merge branch 'yindanlei' into 'master'

Yindanlei

See merge request !56
parents 17aa35bf 19322a17
......@@ -184,8 +184,7 @@ LEFT JOIN
WHERE partition_day=regexp_replace(date_sub(current_date(),1),'-','')
AND REGEXP_REPLACE(SUBSTR(call_time,0,10), '-', '')>='20200701'
AND REGEXP_REPLACE(SUBSTR(call_time,0,10), '-', '')<=regexp_replace(date_sub(current_date(),1),'-','')
--AND start_time+ interval 30 second <= release_time --通话时长大于30秒
AND unix_timestamp(substr(start_time,1,19))+30<=unix_timestamp(substr(release_time,1,19))
AND release_time>start_time
)a
LEFT JOIN
(
......@@ -301,8 +300,7 @@ LEFT JOIN
WHERE partition_day=regexp_replace(date_sub(current_date(),1),'-','')
AND REGEXP_REPLACE(SUBSTR(call_time,0,10), '-', '')>='20200701'
AND REGEXP_REPLACE(SUBSTR(call_time,0,10), '-', '')<=regexp_replace(date_sub(current_date(),1),'-','')
--AND start_time+ interval 30 second <= release_time --通话时长大于30秒
AND unix_timestamp(substr(start_time,1,19))+30<=unix_timestamp(substr(release_time,1,19))
AND release_time>start_time
)a
LEFT JOIN
(
......
yeji_day=业绩基础数据
\ No newline at end of file
--***************************************************************
--*脚本名称:
--*功能: 业绩基础数据
--*业务名称: pm
--*输入数据:
--*作者: yindanlei@igengmei.com
--*更新时间:2020-09-22
--***************************************************************
--设置全局变量&UDF
SET mapreduce.job.queuename=data;
--使用bl数据库
USE pm;
--创建BL层内部表
CREATE TABLE IF NOT EXISTS pm.tl_pm_yeji_d
(
data string comment '{"chs_name":"日期","description":"","etl":"","value":"","remark":""}',
merchant_name string comment '{"chs_name":"商户名称","description":"","etl":"","value":"","remark":""}',
business_group_name string comment '{"chs_name":"商务组","description":"","etl":"","value":"","remark":""}',
business_partener_name string comment '{"chs_name":"商务名称","description":"","etl":"","value":"","remark":""}',
city_name string comment '{"chs_name":"城市","description":"","etl":"","value":"","remark":""}',
hexin_pv BIGINT comment '{"chs_name":"核心页pv","description":"","etl":"","value":"","remark":""}',
service_pv BIGINT comment '{"chs_name":"美购页pv","description":"","etl":"","value":"","remark":""}',
clue_num BIGINT comment '{"chs_name":"有效线索人次","description":"","etl":"","value":"","remark":""}',
discount BIGINT comment '{"chs_name":"总验证抽成","description":"","etl":"","value":"","remark":""}',
recharge_amount BIGINT comment '{"chs_name":"广告收款","description":"","etl":"","value":"","remark":""}',
chongzhi_amount BIGINT comment '{"chs_name":"广告消耗","description":"","etl":"","value":"","remark":""}',
all_amount BIGINT comment '{"chs_name":"广告总消耗(含返点)","description":"","etl":"","value":"","remark":""}',
cpc_amount BIGINT comment '{"chs_name":"cpc总消耗","description":"","etl":"","value":"","remark":""}',
cpc_chongzhi_amount BIGINT comment '{"chs_name":"cpc充值消耗","description":"","etl":"","value":"","remark":""}',
budget BIGINT comment '{"chs_name":"cpc商品有效预算","description":"","etl":"","value":"","remark":""}',
cpc_click_num BIGINT comment '{"chs_name":"cpc点击数","description":"","etl":"","value":"","remark":""}',
liulan_amount BIGINT comment '{"chs_name":"浏览收入","description":"","etl":"","value":"","remark":""}',
sixin_amount BIGINT comment '{"chs_name":"私信收入","description":"","etl":"","value":"","remark":""}',
service_price 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 ml_device_day_active_status
\ No newline at end of file
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_doctor_event_indic_day
\ No newline at end of file
#step1_12.job
#step1_10.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
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online tl_hdfs_budanluru_view
\ No newline at end of file
#step1_11.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_user_updates
\ No newline at end of file
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online tl_maidan_order_view
\ No newline at end of file
#step1_12.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive ml ml_c_ct_mc_merchant_indic_d
\ No newline at end of file
#step1_13.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive ml ml_c_ct_ui_user_dimen_d
\ No newline at end of file
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive ml ml_c_ct_mc_merchantadclassify_indic_d
\ No newline at end of file
#step1_14.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_user_history_detail
\ No newline at end of file
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online tl_hdfs_cpc_clicklog_view
\ 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_updates
\ No newline at end of file
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_doctor_relation_dimen_day
\ No newline at end of file
#step1_5.job
#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_4.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
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ML_TRADE_ORDER_DETAIL_DAY
\ No newline at end of file
#step1_10.job
#step1_5.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
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_6.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
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_7.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
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_8.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
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_phone_binding
\ No newline at end of file
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive tl tl_gm_sl_lead_task
\ 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,step1_14,step1_15,step1_16
command=sh /home/bi/bi-report/lib/shell/hive fangan_day
\ No newline at end of file
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
command=sh /home/bi/bi-report/lib/shell/hive yeji_day
\ No newline at end of file
#step3.job
type=command
dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/yeji_day/jiaweijie@igengmei.com/zhanghaoyu@igengmei.com,cp-sunyinghe@igengmei.com,yindanlei@igengmei.com
\ No newline at end of file
--业绩基础数据
SELECT
data AS `日期`
,merchant_name AS `商户名称`
,business_group_name AS `商务组`
,business_partener_name AS `商务名称`
,city_name AS `城市`
,hexin_pv AS `核心页pv`
,service_pv AS `美购页pv`
,clue_num AS `有效线索人次`
,discount AS `总验证抽成`
,recharge_amount AS `广告收款`
,chongzhi_amount AS `广告消耗`
,all_amount AS `广告总消耗(含返点)`
,cpc_amount AS `cpc总消耗`
,cpc_chongzhi_amount AS `cpc充值消耗`
,budget AS `cpc商品有效预算`
,cpc_click_num AS `cpc点击数`
,liulan_amount AS `浏览收入`
,sixin_amount AS `私信收入`
,service_price AS `纯用户支付金额`
FROM pm.tl_pm_yeji_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