hive custom udf function registration (permanent registration)

 
 

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!

Published 19 original articles · praised 4 · 170,000 views +

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!

Guess you like

Origin blog.csdn.net/u011250186/article/details/105575458