datafu.pig.sets
Class SetUnion
java.lang.Object
org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>
datafu.pig.sets.SetOperationsBase
datafu.pig.sets.SetUnion
public class SetUnion
- extends datafu.pig.sets.SetOperationsBase
Computes the set union of two or more bags. Duplicates are eliminated.
Example:
define SetUnion datafu.pig.sets.SetUnion();
-- input:
-- ({(2,20),(3,30),(4,40)},{(1,10),(2,20),(4,40),(8,80)})
input = LOAD 'input' AS (B1:bag{T:tuple(val1:int,val2:int)},B2:bag{T:tuple(val1:int,val2:int)});
-- output:
-- ({(2,20),(3,30),(4,40),(1,10),(8,80)})
output = FOREACH input GENERATE SetUnion(B1,B2);
Fields inherited from class org.apache.pig.EvalFunc |
log, pigLogger, reporter, returnType |
Method Summary |
org.apache.pig.data.DataBag |
exec(org.apache.pig.data.Tuple input)
|
Methods inherited from class datafu.pig.sets.SetOperationsBase |
outputSchema |
Methods inherited from class org.apache.pig.EvalFunc |
finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SetUnion
public SetUnion()
exec
public org.apache.pig.data.DataBag exec(org.apache.pig.data.Tuple input)
throws java.io.IOException
- Specified by:
exec
in class org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>
- Throws:
java.io.IOException
Matthew Hayes, Sam Shah