org.apache.pig.builtin
Class DIFF

java.lang.Object
  extended by org.apache.pig.EvalFunc<DataBag>
      extended by org.apache.pig.builtin.DIFF

public class DIFF
extends EvalFunc<DataBag>

DIFF compares the fields of a tuple with arity 2. If the fields are DataBags, it will emit any Tuples that are in on of the DataBags but not the other. If the fields are values, it will emit tuples with values that do not match.


Field Summary
 
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
 
Constructor Summary
DIFF()
           
 
Method Summary
 DataBag exec(Tuple input)
          Compares a tuple with two fields.
 
Methods inherited from class org.apache.pig.EvalFunc
finish, getArgToFuncMapping, 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

DIFF

public DIFF()
Method Detail

exec

public DataBag exec(Tuple input)
             throws IOException
Compares a tuple with two fields. Emits any differences.

Specified by:
exec in class EvalFunc<DataBag>
Parameters:
input - a tuple with exactly two fields.
Returns:
result, of type T.
Throws:
IOException - if there are not exactly two fields in a tuple


Copyright © ${year} The Apache Software Foundation