public class TransposeTupleToBag extends AliasableEvalFunc<org.apache.pig.data.DataBag>
define TransposeTupleToBag datafu.pig.util.TransposeTupleToBag();
-- input: 1,10,11,12
input = LOAD 'input' AS (id:int,val1:int,val2:int,val3:int);
-- produces: 1,{("val1",10),("val2",11),("val3",12)}
output = FOREACH input GENERATE id, TransposeTupleToBag(val1 .. val3);
Constructor and Description |
---|
TransposeTupleToBag() |
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 |
getOutputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
Specify the output schema as in {link EvalFunc#outputSchema(Schema)}.
|
getBag, getBoolean, getDouble, getDouble, getFieldAliases, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getObject, getPosition, getPosition, getPrefixedAliasName, getString, getString, outputSchema
getContextProperties, getInstanceName, getInstanceProperties, setUDFContextSignature
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, warn
public org.apache.pig.impl.logicalLayer.schema.Schema getOutputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
AliasableEvalFunc
getOutputSchema
in class AliasableEvalFunc<org.apache.pig.data.DataBag>
input
- input schemapublic 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