diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/UDF.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/UDF.java index 099c7cd..f8bc889 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/UDF.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/UDF.java @@ -21,17 +21,37 @@ import org.apache.hadoop.hive.ql.udf.UDFType; /** - * A User-defined function (UDF) for the use with Hive. - * - * New UDF classes need to inherit from this UDF class. - * - * Required for all UDF classes: 1. Implement one or more methods named - * "evaluate" which will be called by Hive. The following are some examples: - * public int evaluate(); public int evaluate(int a); public double evaluate(int - * a, double b); public String evaluate(String a, int b, String c); - * - * "evaluate" should never be a void method. However it can return "null" if + * A User-defined function (UDF) for use with Hive. + *

+ * New UDF classes need to inherit from this UDF class (or from {@link + * org.apache.hadoop.hive.ql.udf.generic.GenericUDF GenericUDF} which provides more flexibility at + * the cost of more complexity). + *

+ * Requirements for all classes extending this UDF are: + *

+ * One instance of this class will be instantiated per JVM and it will not be called concurrently. + * + * @see Description + * @see UDFType */ @UDFType(deterministic = true) public class UDF { @@ -49,7 +69,7 @@ public UDF() { } /** - * The constructor with user-provided UDFMethodResolver. + * The constructor with user-provided {@link UDFMethodResolver}. */ protected UDF(UDFMethodResolver rslv) { this.rslv = rslv; @@ -58,8 +78,7 @@ protected UDF(UDFMethodResolver rslv) { /** * Sets the resolver. * - * @param rslv - * The method resolver to use for method resolution. + * @param rslv The method resolver to use for method resolution. */ public void setResolver(UDFMethodResolver rslv) { this.rslv = rslv; @@ -73,13 +92,25 @@ public UDFMethodResolver getResolver() { } /** - * These can be overriden to provide the same functionality as the - * correspondingly named methods in GenericUDF. + * This can be overridden to include JARs required by this UDF. + * + * @see org.apache.hadoop.hive.ql.udf.generic.GenericUDF#getRequiredJars() + * GenericUDF.getRequiredJars() + * + * @return an array of paths to files to include, {@code null} by default. */ public String[] getRequiredJars() { return null; } + /** + * This can be overridden to include files required by this UDF. + * + * @see org.apache.hadoop.hive.ql.udf.generic.GenericUDF#getRequiredFiles() + * GenericUDF.getRequiredFiles() + * + * @return an array of paths to files to include, {@code null} by default. + */ public String[] getRequiredFiles() { return null; }