Commit 6313768a by mengdongxing

Update tkdm_output_app_cumsum_all.sql

parent ff9effe7
insert overwrite table tkdm.tkdm_output_app_cumsum_all partition(ds='$ds')
select appid,
select '$ds' as dt,
appid,
sum(cum_dupnum_click_all) as cum_dupnum_click_all,
sum(cum_num_install) as cum_num_install,
sum(cum_dupnum_reged_day) as cum_dupnum_reged_day,
......@@ -21,7 +22,7 @@ select appid,
cum_amt_income_all_user,
cum_num_payer_all_user
from tkdm.tkdm_output_app_cumsum_all
where ds=date_sub('2017-03-01',1)
where ds=date_sub('$ds',1)
union all
......@@ -36,13 +37,14 @@ select appid,
sum(amt_income_all_user) as cum_amt_income_all_user,
sum(num_payer_all_user) as cum_num_payer_all_user
from tkdm.tkdm_data_app_summary_day
where ds='2017-03-01'
where ds='$ds'
group by appid
) as t group by appid
create EXTERNAL table tkdm_output_app_cumsum_all(
dt string,
appid string,
cum_dupnum_click_all int,
cum_num_install int,
......@@ -57,4 +59,4 @@ PARTITIONED BY (ds string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
location 's3://reyuntkio/warehouse/tkio/tkdm.db/tkdm_output_app_cumsum_all'
;
\ 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