datafu.pig.numbers
Class RandInt

java.lang.Object
  extended by org.apache.pig.EvalFunc<T>
      extended by datafu.pig.util.SimpleEvalFunc<java.lang.Integer>
          extended by datafu.pig.numbers.RandInt

public class RandInt
extends SimpleEvalFunc<java.lang.Integer>

Generates a uniformly distributed integer between two bounds


Field Summary
 
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
 
Constructor Summary
RandInt()
           
 
Method Summary
 java.lang.Integer call(java.lang.Integer min, java.lang.Integer max)
           
 org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
           
 
Methods inherited from class datafu.pig.util.SimpleEvalFunc
exec, getReturnType
 
Methods inherited from class org.apache.pig.EvalFunc
finish, getArgToFuncMapping, getCacheFiles, getLogger, getPigLogger, getReporter, getSchemaName, isAsynchronous, progress, setPigLogger, setReporter, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandInt

public RandInt()
Method Detail

call

public java.lang.Integer call(java.lang.Integer min,
                              java.lang.Integer max)
                       throws java.io.IOException
Parameters:
min - lower bound for random number
max - upper bound for random number
Throws:
java.io.IOException

outputSchema

public org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
Overrides:
outputSchema in class org.apache.pig.EvalFunc<java.lang.Integer>


Matthew Hayes, Sam Shah