hive 自定義udf函數註冊(永久註冊)

1.臨時註冊

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.刪除註冊函數

drop temporary function helloworld;

3.永久註冊函數

create function helloword as 'com.it.applogs.udf.DayStartUDF' using jar 'hdfs:/jars/hive-functions-0.0.1.jar';

注意:永久註冊需要將jar包上傳到hdfs,否則在集羣中運行的時候,會出現找不到jar包的情況!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章