pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Dai <da...@hortonworks.com>
Subject Re: is there a random sample function with seed
Date Mon, 18 May 2015 05:03:18 GMT
RANDOM takes a seed. You can do a filter with RANDOM:


define rand100 RANDOM(β€˜100');

table1 = load 'school' using org.apache.hcatalog.pig.HCatLoader();
table2 = filter table1 by rand100()<0.01;



Daniel
On 5/15/15, 2:27 AM, "ζŽθΏη”°" <cumtshu@163.com> wrote:

>I USE 
> table1 = load 'school' using org.apache.hcatalog.pig.HCatLoader();
>table2 = sample table 0.01;
>every time I dump table2 ,I get different result, Is there one sample
>function with seed? so  the result is not changed every time.
>thank you.

Mime
View raw message