org.apache.pig.piggybank.evaluation.string
Class UPPER

java.lang.Object
  extended by org.apache.pig.EvalFunc<String>
      extended by org.apache.pig.piggybank.evaluation.string.UPPER

public class UPPER
extends EvalFunc<String>

string.UPPER implements eval function to convert a string to upper case Example: register pigudfs.jar; A = load 'mydata' as (name); B = foreach A generate string.UPPER(name); dump B;


Field Summary
 
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
 
Constructor Summary
UPPER()
           
 
Method Summary
 String exec(Tuple input)
          Upper-cases an input string.
 List<FuncSpec> getArgToFuncMapping()
           
 Schema outputSchema(Schema input)
          This method gives a name to the column.
 
Methods inherited from class org.apache.pig.EvalFunc
finish, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, isAsynchronous, progress, setPigLogger, setReporter, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UPPER

public UPPER()
Method Detail

exec

public String exec(Tuple input)
            throws IOException
Upper-cases an input string.

Specified by:
exec in class EvalFunc<String>
Parameters:
input - tuple; first column is assumed to have the column to convert
Returns:
result, of type T.
Throws:
IOException

outputSchema

public Schema outputSchema(Schema input)
This method gives a name to the column.

Overrides:
outputSchema in class EvalFunc<String>
Parameters:
input - - schema of the input data
Returns:
schema of the input data

getArgToFuncMapping

public List<FuncSpec> getArgToFuncMapping()
                                   throws FrontendException
Overrides:
getArgToFuncMapping in class EvalFunc<String>
Returns:
A List containing FuncSpec objects representing the Function class which can handle the inputs corresponding to the schema in the objects
Throws:
FrontendException


Copyright © ${year} The Apache Software Foundation