hive 永久udf函数
来源:互联网 发布:富网店淘宝课程怎么样 编辑:程序博客网 时间:2024/04/28 16:54
开发环境:cdh5.4.8,hive1.1
最近需要开发一些永久的函数供业务使用,在hive的早期版本中,只能添加临时函数或者修改一些源代码来添加永久函数,后面找到了下面的文档来创建永久函数
Permanent Functions
In Hive 0.13 or later, functions can be registered to the metastore, so they can be referenced in a query without having to create a temporary function each session.
Create Function
CREATE FUNCTION [db_name.]function_name AS class_name
[USING JAR|FILE|ARCHIVE 'file_uri' [, JAR|FILE|ARCHIVE 'file_uri'] ];
这里需要先把开发好的jar包上传到hdfs上
hadoop fs -put xx.jar /user/hive/udfs/
然后创建函数:
CREATE FUNCTION time_diff_bl AS 'com.bl.bigdata.udf.DateDiffer' using jar 'hdfs://nameservice1:8020/user/hive/udf/bl_udfs-0.0.1-SNAPSHOT.jar';
这样就可以使用了。
2.hue中udf的使用
最近需要开发一些永久的函数供业务使用,在hive的早期版本中,只能添加临时函数或者修改一些源代码来添加永久函数,后面找到了下面的文档来创建永久函数
Permanent Functions
In Hive 0.13 or later, functions can be registered to the metastore, so they can be referenced in a query without having to create a temporary function each session.
Create Function
CREATE FUNCTION [db_name.]function_name AS class_name
[USING JAR|FILE|ARCHIVE 'file_uri' [, JAR|FILE|ARCHIVE 'file_uri'] ];
这里需要先把开发好的jar包上传到hdfs上
hadoop fs -put xx.jar /user/hive/udfs/
然后创建函数:
CREATE FUNCTION time_diff_bl AS 'com.bl.bigdata.udf.DateDiffer' using jar 'hdfs://nameservice1:8020/user/hive/udf/bl_udfs-0.0.1-SNAPSHOT.jar';
这样就可以使用了。
2.hue中udf的使用
在hive界面的左边中选择settings->file resources(add)->选择hdfs上的jar->execute 就可以用了
参考:https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-CreateFunction
0 0
- hive 永久udf函数
- hive 永久udf函数
- hive udf开发以及永久注册udf函数
- hive udf开发以及永久注册udf函数
- 开发hive UDF函数
- HIVE 自定义函数 UDF
- HIVE UDF函数(一)
- hive的UDF 函数
- hive的UDF 函数
- HIVE UDF函数使用
- 开发hive UDF函数
- Hive UDF函数
- Hive自定义函数-UDF
- hive UDF函数开发
- hive自定义函数UDF
- hive UDF函数
- hive的UDF 函数
- Hive自定义函数UDF
- hdu 2049 错排 不容易系列之(4)——考新郎
- 熟悉了一段时间的swift,正好要新开一个项目,直接拿swift开撸吧!新年第一天班,祝项目顺利!!!
- UIImageView的基本用法
- CS 20SI|Lecture 4 Structure your TensorFlow model
- crontab定时任务
- hive 永久udf函数
- UITableView 出现卡顿的原因
- Android之Fragment入门一
- Vue.js插值
- 04-each-循环中使用this
- ios--成员变量与属性的区别
- 绘王领跑“数字绘画+智慧教育”教育装备
- Java运用JFrame实现右键菜单改变背景颜色
- bootstrap-datetimepicker 火狐浏览器报错