Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Table of Contents

Creating Custom UDFs

First, you need to create a new class that extends UDF, with one or more methods named evaluate.

...

For a more involved example, see this page.

As of Hive 0.13, you can register your function as a permanent UDF either in the current database or in a specified database, as described in Permanent Functions. For example:

Code Block
create function my_db.my_lower as 'com.example.hive.udf.Lower';

Deploying Jars for User Defined Functions and User Defined SerDes

...

Code Block
hive> list jars;
my_jar.jar

See Hive CLI for full syntax and more examples.

As of Hive 0.13, UDFs also have the option of of being able to specify required jars in the CREATE FUNCTION statement:

Code Block
CREATE FUNCTION myfunc AS 'myclass' USING JAR 'hdfs:///path/to/jar';

...