org.apache.pig
Class FuncSpec
java.lang.Object
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
FuncSpec
public FuncSpec(String className,
String ctorArg)
- Parameters:
className
- the name of the class for the udfctorArg
- 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 udfctorArgs
- 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 udfctorArgs
- the arguments for the constructor for the above classinputArgsSchema
- 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
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