Search code examples
hadoophiveudf

describe hive custom UDF documentation


I have created a custom UDF in Java which I can use in Hive. Can you let me know how/where I can add some documentation to this UDF?

I want to view this documentation while giving DESCRIBE FUNCTION <CUSTOM UDF> in hive.


Solution

  • Place an Annotation of type 'org.apache.hadoop.hive.ql.exec.Description' on your UDF class, with your description in the value field

    For example

     import org.apache.hadoop.hive.ql.exec.Description;
     import org.apache.hadoop.hive.ql.exec.UDF;
    
     @Description(name="fantastic",
        value="does the most fantastic thing ever")
     public class FantasticUDF extends UDF {
    
      ....
     }