Commit d8590517 by mengdongxing

Update tkdm_output_active_cid_std_week.sql

parent 36e8585f
......@@ -5,6 +5,7 @@ insert overwrite table tkdm.tkdm_output_active_cid_std_week partition(ds='2017-0
select /*+ mapjoin(x)*/ x.appid,
'2017-02-22' as week_dt,
y.cid,
x.category_id,
x.isgame,
......@@ -13,6 +14,14 @@ select /*+ mapjoin(x)*/ x.appid,
nvl(y.bootstarp_med_ins_rate,-1) as bootstarp_med_ins_rate
from
(select appid,category_id,isgame
from tkio_v2.tkio_dp_app_info
where ds='2017-02-28'
) as x
left join
(select category_id,
isgame,
cid,
......@@ -22,20 +31,14 @@ from
from tkdm.tkdm_data_active_summary_day
where ds between '2017-02-22' and '2017-02-28'
group by category_id, isgame,cid
) y
left join
(select appid,category_id,isgame
from tkio_v2.tkio_dp_app_info
where ds='2017-02-28'
) as x on x.category_id=y.category_id and x.isgame=y.isgame
) y on x.category_id=y.category_id and x.isgame=y.isgame
create EXTERNAL table tkdm_output_active_cid_std_week(
appid string,
week_dt string,
cid int,
category_id int,
isgame int,
......@@ -48,3 +51,4 @@ ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
location 's3://reyuntkio/warehouse/tkio/tkdm.db/tkdm_output_active_cid_std_week'
;
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