1.创建临时函数

hive> add jar /home/hadoop/bigdata_udf.jar;
hive> create temporary function isContains100 as 'com.xx.hive.udf.hm2.IsContains100';
--验证
hive> select isContains100(t.col1) from t limit 10;
hive> drop temporary function isContains100;

2.创建永久函数

hadoop fs -put /opt/bigdata_udf.jar /udf
hive> create function default.url_decode as 'com.xx.udf.DecodeURL' using jar 'hdfs:///udf/bigdata_udf.jar';
--验证
hive> select default.url_decode(t.col1) from t limit 10;

注意:注册永久函数必须使用hdfs路径,不可使用本地路径