public class INVERSEMAP extends EvalFunc<Map>
Note: 1. UDF accepts Map with Values of primitive data type 2. UDF returns Mapgrunt> cat 1data [open#1,1#2,11#2] [apache#2,3#4,12#24]
grunt> a = load 'data' as (M:[int]); grunt> b = foreach a generate INVERSEMAP($0); grunt> dump b; ([2#{(1),(11)},apache#{(open)}]) ([hadoop#{(apache),(12)},4#{(3)}])
EvalFunc.SchemaType
log, pigLogger, reporter, returnType
Constructor and Description |
---|
INVERSEMAP() |
Modifier and Type | Method and Description |
---|---|
boolean |
allowCompileTimeCalculation()
Whether the UDF should be evaluated at compile time if all inputs are constant.
|
Map |
exec(Tuple input)
This callback method must be implemented by all subclasses.
|
Schema |
outputSchema(Schema input)
Report the schema of the output of this UDF.
|
finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLoadCaster, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public Map exec(Tuple input) throws IOException
EvalFunc
exec
in class EvalFunc<Map>
input
- the Tuple to be processed.IOException
public Schema outputSchema(Schema input)
EvalFunc
The default implementation interprets the OutputSchema
annotation,
if one is present. Otherwise, it returns null
(no known output schema).
outputSchema
in class EvalFunc<Map>
input
- Schema of the inputpublic boolean allowCompileTimeCalculation()
EvalFunc
allowCompileTimeCalculation
in class EvalFunc<Map>
Copyright © 2007-2017 The Apache Software Foundation