hive部署UDF函数-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
hive部署UDF函数

一.临时添加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


新闻标题:hive部署UDF函数
链接地址:http://scgulin.cn/article/pgpepj.html