public class CustomFormatToISO extends EvalFunc<String>
Example usage: REGISTER /Users/me/commiter/piggybank/java/piggybank.jar ; REGISTER /Users/me/commiter/piggybank/java/lib/joda-time-1.6.jar ; DEFINE CustomFormatToISO org.apache.pig.piggybank.evaluation.datetime.convert.CustomFormatToISO(); CustomIn = LOAD 'test3.tsv' USING PigStorage('\t') AS (dt:chararray); DESCRIBE CustomIn; CustomIn: {dt: chararray} DUMP CustomIn; (10-1-2010) toISO = FOREACH CustomIn GENERATE CustomFormatToISO(dt, "MM-dd-YYYY") AS ISOTime:chararray; DESCRIBE toISO; toISO: {ISOTime: chararray} DUMP toISO; (2010-10-01T00:00:00.000Z) ...
EvalFunc.SchemaType
log, pigLogger, reporter, returnType
Constructor and Description |
---|
CustomFormatToISO() |
Modifier and Type | Method and Description |
---|---|
String |
exec(Tuple input)
This callback method must be implemented by all subclasses.
|
List<FuncSpec> |
getArgToFuncMapping()
Allow a UDF to specify type specific implementations of itself.
|
Schema |
outputSchema(Schema input)
Report the schema of the output of this UDF.
|
allowCompileTimeCalculation, finish, getCacheFiles, getInputSchema, getLoadCaster, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public String exec(Tuple input) throws IOException
EvalFunc
exec
in class EvalFunc<String>
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<String>
input
- Schema of the inputpublic List<FuncSpec> getArgToFuncMapping() throws FrontendException
EvalFunc
getArgToFuncMapping
in class EvalFunc<String>
FrontendException
Copyright © 2007-2017 The Apache Software Foundation