Wednesday, July 10, 2013

Adding custom jar files for UDFs in Hive cli using hiverc

To add custom functionality such as UDF Jars while using Hive CLI, just add your settings to the .hiverc file

So let's say you are developing a UDF on your machine and want to test how it will behave in hive, simply put the below in your hiverc and it will get loaded whenever you start a new hive cli sesssion.

add jar CustomUDFLib.jar;
create temporary function function1 AS 'com.yourcompany.hive.udf.function1';
create temporary function function2 AS 'com.yourcompany.hive.udf.function2';

The hiverc file like all rc files must reside in your home directory.

No comments:

Post a Comment