1. Temporary registration
2. Delete the registration function
3. Permanent registration function
Note: The jar package needs to be uploaded to hdfs for permanent registration, otherwise the jar package will not be found when running in the cluster! |
1. Temporary registration
1.导入jar包
2.部署到hive的lib下。
3.添加jar到hive的classpath
$hive>add jar app-logs-hive-1.0-SNAPSHOT.jar ;
4.注册临时函数
$hive>create temporary function helloworld AS 'com.it.applogs.udf.DayStartUDF';
2. Delete the registration function
drop temporary function helloworld;
3. Permanent registration function
create function helloword as 'com.it.applogs.udf.DayStartUDF' using jar 'hdfs:/jars/hive-functions-0.0.1.jar';
Note: The jar package needs to be uploaded to hdfs for permanent registration, otherwise the jar package will not be found when running in the cluster!