public class Sample extends Object
| Constructor and Description |
|---|
Sample() |
| Modifier and Type | Method and Description |
|---|---|
static <S> PCollection<S> |
sample(PCollection<S> input,
double probability)
Output records from the given
PCollection with the given probability. |
static <S> PCollection<S> |
sample(PCollection<S> input,
long seed,
double probability)
Output records from the given
PCollection using a given seed. |
static <K,V> PTable<K,V> |
sample(PTable<K,V> input,
double probability)
A
PTable<K, V> analogue of the sample function. |
static <K,V> PTable<K,V> |
sample(PTable<K,V> input,
long seed,
double probability)
A
PTable<K, V> analogue of the sample function. |
public static <S> PCollection<S> sample(PCollection<S> input, double probability)
PCollection with the given probability.input - The PCollection to sample fromprobability - The probability (0.0 < p < 1.0)PCollection created from samplingpublic static <S> PCollection<S> sample(PCollection<S> input, long seed, double probability)
PCollection using a given seed. Useful for unit
testing.input - The PCollection to sample fromseed - The seedprobability - The probability (0.0 < p < 1.0)PCollection created from samplingpublic static <K,V> PTable<K,V> sample(PTable<K,V> input, double probability)
PTable<K, V> analogue of the sample function.Copyright © 2013 The Apache Software Foundation. All Rights Reserved.