public class BagConcat
extends org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>
This UDF accepts two forms of input:
Example 1:
define BagConcat datafu.pig.bags.BagConcat();
-- This example illustrates the use on a tuple of bags
-- input:
-- ({(1),(2),(3)},{(3),(4),(5)})
-- ({(20),(25)},{(40),(50)})
input = LOAD 'input' AS (A: bag{T: tuple(v:INT)}, B: bag{T: tuple(v:INT)});
-- output:
-- ({(1),(2),(3),(3),(4),(5)})
-- ({(20),(25),(40),(50)})
output = FOREACH input GENERATE BagConcat(A,B);
Example 2:
define BagConcat datafu.pig.bags.BagConcat();
-- This example illustrates the use on a bag of bags
-- input:
-- ({({(1),(2),(3)}),({(3),(4),(5)})})
-- ({({(20),(25)}),({(40),(50)})})
input = LOAD 'input' AS (A: bag{T: tuple(bag{T2: tuple(v:INT)})});
-- output:
-- ({(1),(2),(3),(3),(4),(5)})
-- ({(20),(25),(40),(50)})
output = FOREACH input GENERATE BagConcat(A);
Constructor and Description |
---|
BagConcat() |
Modifier and Type | Method and Description |
---|---|
org.apache.pig.data.DataBag |
exec(org.apache.pig.data.Tuple input) |
org.apache.pig.impl.logicalLayer.schema.Schema |
outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input) |
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public org.apache.pig.data.DataBag exec(org.apache.pig.data.Tuple input) throws java.io.IOException
exec
in class org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>
java.io.IOException
public org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
outputSchema
in class org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>