Not sure if you got an answer for this.
You can look at the following test case in the source tree to guide you on how to build a udf. Will put this on the wiki.
The udf has to implement either the UDF interface or the GenericUDF interface. The later handles cases for UDFs that can take complex objects as arguments or have variable length arguments or return complex objects. The UDF interface is easier to program to, but is more limited than the GenericUDF interface.
There are some nuances that you need to be aware of about the function resolution logic incase the UDF has polymorphism in the evaluate functions. I can go into more details if that is the case for you.
From: Saurabh Nanda
Sent: Tuesday, July 14, 2009 1:09 AM
Subject: Creating a UDF (was Hive SerDe?)
I'm trying to register a UDF to parse my log file format. Where can I find documentation for creating and registering a UDF?
My attempts failed with this error:
hive> create temporary function process_line as 'LogProcessor';
FAILED: Unknown exception : Registering UDF Class class LogProcessor which does not extends class org.apache.hadoop.hive.ql.exec.UDF
1. Do I need to define the a particular function in the class? For example, run()
2. What arguments should that function accept?
3. What should be the return type of that function?
4. What if the function needs to return multiple values? Each value mapping to a column in the table?