溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

hive 部署UDF函數

發布時間:2020-08-01 22:00:19 來源:網絡 閱讀:587 作者:hahhahahahah 欄目:大數據

一.臨時添加UDF函數

    1.上傳jar包至hive服務器

    2.hive shell執行如下命令:  

add jar /home/hive/hivejar/billing-on-hive-1.0.jar
create temporary function strip as 'com.tsingzone.bigdata.billing.GetOperator';
注:
strip:自定義函數名
com.tsingzone.bigdata.billing.GetOperator:類名
僅對當前shell生效

   3.使用方法:

     

select strip(dest_termi_id) from huadan201601 limit 10;

二.永久添加UDF函數

    1.上傳jar包至hdfs中

      

hdfs dfs -put hivejar/billing-on-hive-1.0.jar /user/hive/hive_jar

    2.創建函數

      

create function billing as 'com.tsingzone.bigdata.billing.GetOperator' using jar 'hdfs:///user/hive/hive_jar/billing-on-hive-1.0.jar'

    3.使用

       

hive -S -e "select billing(dest_termi_id) from huadan201601 limit 10;"

     

   參考文檔:http://blog.csdn.net/liam08/article/details/51311772

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女