网上大部分资料显示注册 Hive udf 函数大体有两种方法:
第一种、创建临时函数。如在hive CLI执行下面命令:
hive> add jar helloudf.jar;
hive> create temporary function helloworld as 'com.hrj.hive.udf.helloUDF';
hive> select helloworld(t.col1) from t limit 10;
hive> drop temporary function helloworld;