网上大部分资料显示注册 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;
第二种、修改源代码,重编译,注册函数。这种方法可以永久性的保存udf函数,但是风险很大,我刚开