insert overwrite table lobehaviour_trade_daily partition (part)
select dp_id, buyer_nick, to_date(created), payment, 0 as item, if(to_date(modified)<'2012-01-01','2012-01-01',to_date(modified)) as part
from taobao.s_trade_hbase
where (part<'2013-10-30' or part='STABLE') and status='TRADE_FINISHED'
distribute by part;
select dp_id, buyer_nick, to_date(created), payment, 0 as item, if(to_date(modified)<'2012-01-01','2012-01-01',to_date(modified)) as part
from taobao.s_trade_hbase
where (part<'2013-10-30' or part='STABLE') and status='TRADE_FINISHED'
distribute by part;