org.apache.pig.impl.builtin
Class RandomSampleLoader
java.lang.Object
org.apache.pig.impl.builtin.SampleLoader
org.apache.pig.impl.builtin.RandomSampleLoader
- All Implemented Interfaces:
- LoadFunc
public class RandomSampleLoader
- extends SampleLoader
A loader that samples the data. This loader can subsume loader that
can handle starting in the middle of a record. Loaders that can
handle this should implement the SamplableLoader interface.
Methods inherited from class org.apache.pig.impl.builtin.SampleLoader |
bindTo, bytesToBag, bytesToCharArray, bytesToDouble, bytesToFloat, bytesToInteger, bytesToLong, bytesToMap, bytesToTuple, computeSamples, determineSchema, fieldsToRead, getNext, getNumSamples |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomSampleLoader
public RandomSampleLoader(String funcSpec,
String ns)
- Construct with a class of loader to use.
- Parameters:
funcSpec
- func spec of the loader to use.ns
- Number of samples per map to collect.
Arguments are passed as strings instead of actual types (FuncSpec, int)
because FuncSpec only supports string arguments to
UDF constructors.
setNumSamples
public void setNumSamples(int n)
- Overrides:
setNumSamples
in class SampleLoader
Copyright © ${year} The Apache Software Foundation