首页 > 其他 > 详细

hive 抽样方法

时间:2017-08-03 10:38:36      阅读:190      评论:0      收藏:0      [点我收藏+]

select *
from (
select *
from advert.dws_advert_order_model_sample_pcvr_v2_di
where dt>= date_sub(‘${date}‘,7) and dt< ‘${date}‘
and ((label >=0.5 and rand()>(1-2*0.05)) or (label <0.5 and rand()>(1-2*0.05)))

union all

select *
from advert.dws_advert_order_model_sample_pcvr_v2_di
where dt=‘${date}‘
and ((label >=0.5 and rand()>(1-2*0.05)) or (label <0.5 and rand()>(1-2*0.05)))
)  tmp

where rand()>0.3;

hive 抽样方法

原文:http://www.cnblogs.com/zhangbojiangfeng/p/7278377.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!