org.apache.pig.impl.builtin
Class ReadScalars

java.lang.Object
  extended by org.apache.pig.EvalFunc<Object>
      extended by org.apache.pig.impl.builtin.ReadScalars

public class ReadScalars
extends EvalFunc<Object>

ReadScalars reads a line from a file and returns it as its value. The file is only read once, and the same line is returned over and over again. This is useful for incorporating a result from an agregation into another evaluation.


Field Summary
 
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
 
Constructor Summary
ReadScalars()
           
 
Method Summary
 Object exec(Tuple input)
          Java level API
 void setOutputBuffer(Map<String,DataBag> inputBuffer)
           
 
Methods inherited from class org.apache.pig.EvalFunc
finish, getArgToFuncMapping, getCacheFiles, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, isAsynchronous, outputSchema, progress, setPigLogger, setReporter, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadScalars

public ReadScalars()
Method Detail

exec

public Object exec(Tuple input)
            throws IOException
Java level API

Specified by:
exec in class EvalFunc<Object>
Parameters:
input - expects a single constant that is the name of the file to be read
Returns:
result, of type T.
Throws:
IOException

setOutputBuffer

public void setOutputBuffer(Map<String,DataBag> inputBuffer)


Copyright © 2007-2012 The Apache Software Foundation