org.apache.pig.impl.builtin
Class GetMemNumRows

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

public class GetMemNumRows
extends EvalFunc<Tuple>

UDF to get memory size of a tuple and extracts number of rows value from special tuple created by PoissonSampleLoader It is used by skewed join.


Field Summary
 
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
 
Constructor Summary
GetMemNumRows()
           
 
Method Summary
 Tuple exec(Tuple in)
          This callback method must be implemented by all subclasses.
 Type getReturnType()
          Get the Type that this EvalFunc returns.
 
Methods inherited from class org.apache.pig.EvalFunc
finish, getArgToFuncMapping, getCacheFiles, getLogger, getPigLogger, getReporter, 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

GetMemNumRows

public GetMemNumRows()
Method Detail

exec

public Tuple exec(Tuple in)
           throws IOException
Description copied from class: EvalFunc
This callback method must be implemented by all subclasses. This is the method that will be invoked on every Tuple of a given dataset. Since the dataset may be divided up in a variety of ways the programmer should not make assumptions about state that is maintained between invocations of this method.

Specified by:
exec in class EvalFunc<Tuple>
Parameters:
in - - input tuple
Returns:
- tuple having size in memory of this tuple and numRows if this is specially marked tuple having number of rows field
Throws:
IOException

getReturnType

public Type getReturnType()
Description copied from class: EvalFunc
Get the Type that this EvalFunc returns.

Overrides:
getReturnType in class EvalFunc<Tuple>
Returns:
Type


Copyright © 2007-2012 The Apache Software Foundation