public class FirstTupleFromBag extends SimpleEvalFunc<org.apache.pig.data.Tuple>
define FirstTupleFromBag datafu.pig.bags.FirstTupleFromBag();
-- input:
-- ({(a,1)})
input = LOAD 'input' AS (B: bag {T: tuple(alpha:CHARARRAY, numeric:INT)});
output = FOREACH input GENERATE FirstTupleFromBag(B, null);
-- output:
-- (a,1)
Constructor and Description |
---|
FirstTupleFromBag() |
Modifier and Type | Method and Description |
---|---|
org.apache.pig.data.Tuple |
call(org.apache.pig.data.DataBag bag,
org.apache.pig.data.Tuple defaultValue) |
org.apache.pig.impl.logicalLayer.schema.Schema |
outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
Override outputSchema so we can verify the input schema at pig compile time, instead of runtime
|
exec, getReturnType
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public org.apache.pig.data.Tuple call(org.apache.pig.data.DataBag bag, org.apache.pig.data.Tuple defaultValue) throws java.io.IOException
java.io.IOException
public org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
SimpleEvalFunc
outputSchema
in class SimpleEvalFunc<org.apache.pig.data.Tuple>
input
- input schema