Commit fd7275ec by mengdongxing

Update tkdm_output_user_cluster_app_day.sql

parent ad7c821f
...@@ -4,15 +4,16 @@ set Mapred.min.split.size.per.rack=256000000 ...@@ -4,15 +4,16 @@ set Mapred.min.split.size.per.rack=256000000
set hive.input.format=org.apache.hadoop.hive.ql.io.CombineHiveInputFormat set hive.input.format=org.apache.hadoop.hive.ql.io.CombineHiveInputFormat
set hive.groupby.skewindata=true; set hive.groupby.skewindata=true;
insert overwrite table tkdm.tkdm_output_user_cluster_app_day partition(ds='2017-02-25') insert overwrite table tkdm.tkdm_output_user_cluster_app_day partition(ds='$ds')
select '2017-02-25' as dt, select '$ds' as dt,
appid, appid,
category_id, category_id,
isgame, isgame,
count(1) as num_user count(if(cid=-1,1,null)) as num_user_def,
count(if(cid!=-1,1,null)) as num_user_cam
from tkdm.tkdm_data_active_detial_day from tkdm.tkdm_data_active_detial_day
where ds='2017-02-25' where ds='$ds'
group by appid,category_id,isgame group by appid,category_id,isgame
cluster by appid,category_id,isgame cluster by appid,category_id,isgame
...@@ -24,7 +25,8 @@ dt string, ...@@ -24,7 +25,8 @@ dt string,
appid int, appid int,
category_id int, category_id int,
isgame int, isgame int,
num_user int num_user_def bigint,
num_user_cam bigint
) )
PARTITIONED BY (ds string) PARTITIONED BY (ds string)
ROW FORMAT DELIMITED ROW FORMAT DELIMITED
......
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