org.apache.pig.impl.builtin
Class RandomSampleLoader

java.lang.Object
  extended by org.apache.pig.impl.builtin.SampleLoader
      extended by 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.


Field Summary
 
Fields inherited from class org.apache.pig.impl.builtin.SampleLoader
loader, numSamples, skipInterval
 
Constructor Summary
RandomSampleLoader(String funcSpec, String ns)
          Construct with a class of loader to use.
 
Method Summary
 void setNumSamples(int n)
           
 
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
 

Constructor Detail

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.
Method Detail

setNumSamples

public void setNumSamples(int n)
Overrides:
setNumSamples in class SampleLoader


Copyright © ${year} The Apache Software Foundation