hive 抽样方法
Posted 江枫1
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hive 抽样方法相关的知识,希望对你有一定的参考价值。
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 抽样方法的主要内容,如果未能解决你的问题,请参考以下文章