org.apache.pig
Class FuncSpec

java.lang.Object
  extended by org.apache.pig.FuncSpec
All Implemented Interfaces:
Serializable, Cloneable

public class FuncSpec
extends Object
implements Serializable, Cloneable

Class to represent a UDF specification - essentially encapsulates the class name and the arguments to the constructor

See Also:
Serialized Form

Constructor Summary
FuncSpec(String funcSpec)
           
FuncSpec(String funcSpec, Schema inputArgsSchema)
           
FuncSpec(String className, String ctorArg)
           
FuncSpec(String className, String[] ctorArgs)
           
FuncSpec(String className, String[] ctorArgs, Schema inputArgsSchema)
           
 
Method Summary
 FuncSpec clone()
           
static String getArgStringFromSpec(String funcSpec)
           
 String getClassName()
           
static String getClassNameFromSpec(String funcSpec)
           
 String[] getCtorArgs()
           
 Schema getInputArgsSchema()
           
static List<String> parseArguments(String argString)
          Function to parse the arguments from a function specification argument list
 void setClassName(String className)
           
 void setCtorArgs(String[] ctorArgs)
           
 void setInputArgsSchema(Schema inputArgsSchema)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FuncSpec

public FuncSpec(String className,
                String ctorArg)
Parameters:
className - the name of the class for the udf
ctorArg - the argument for the constructor for the above class

FuncSpec

public FuncSpec(String className,
                String[] ctorArgs)
Parameters:
className - the name of the class for the udf
ctorArgs - the arguments for the constructor for the above class

FuncSpec

public FuncSpec(String className,
                String[] ctorArgs,
                Schema inputArgsSchema)
Parameters:
className - the name of the class for the udf
ctorArgs - the arguments for the constructor for the above class
inputArgsSchema - schema for input args taken by this Function

FuncSpec

public FuncSpec(String funcSpec)
Parameters:
funcSpec - the name of the function and any arguments. It should have the form: classname('arg1', 'arg2', ...)

FuncSpec

public FuncSpec(String funcSpec,
                Schema inputArgsSchema)
Parameters:
funcSpec - funcSpec the name of the function and any arguments. It should have the form: classname('arg1', 'arg2', ...)
inputArgsSchema - schema for input args taken by this Function
Method Detail

getClassNameFromSpec

public static String getClassNameFromSpec(String funcSpec)

getArgStringFromSpec

public static String getArgStringFromSpec(String funcSpec)

parseArguments

public static List<String> parseArguments(String argString)
Function to parse the arguments from a function specification argument list

Parameters:
argString - should be of the form "'arg1', 'arg2', ..."
Returns:
List of the different argument strings

getClassName

public String getClassName()
Returns:
the className

setClassName

public void setClassName(String className)
Parameters:
className - the className to set

getCtorArgs

public String[] getCtorArgs()
Returns:
the ctorArgs

setCtorArgs

public void setCtorArgs(String[] ctorArgs)
Parameters:
ctorArgs - the ctorArgs to set

toString

public String toString()
Overrides:
toString in class Object

getInputArgsSchema

public Schema getInputArgsSchema()
Returns:
the inputArgsSchema

setInputArgsSchema

public void setInputArgsSchema(Schema inputArgsSchema)
Parameters:
inputArgsSchema - the inputArgsSchema to set

clone

public FuncSpec clone()
               throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException


Copyright © ${year} The Apache Software Foundation