今天导出广东联通7月份的数据,包含点播和直播的数据明细:
insert overwrite local directory'/tmp/300020' row format delimited fields terminated by ','
selectt.dim_user_hid,t.dim_oem_id,t.fristdate,dimcache('area',m.areaid) from
(selectdim_user_hid,dim_oem_id,min(metric_fristdate) as fristdate from sum1_user where(vod=1 or vod=4) and dim_oem_id in(452,231,558,711,765,417,420,556,609,707,758,759,811,300008,300044,300061,300060,300076,300077,300094,300140,300157,300159,300195,30019,30022)and metric_fristdate>='2016-07-01' and metric_fristdate<='2016-07-31'group by dim_user_hid,dim_oem_id) t
join
(selectdim_user_hid,dim_oem_id,collect_set(dim_area_id)[0]as areaid from fact_vod_history whereday>='2016-07-01' and day<='2016-07-31' and dim_oem_id in(452,231,558,711,765,417,420,556,609,707,758,759,811,300008,300044,300061,300060,300076,300077,300094,300140,300157,300159,300195,30019,30022)group by dim_oem_id,dim_user_hid) m
on (t.dim_user_hid=m.dim_user_hid andt.dim_oem_id=m.dim_oem_id);