Hive 自定义函数(UDF)开发
来源:互联网 发布:重庆seo俱乐部 编辑:程序博客网 时间:2024/06/09 16:17
0.要继承org.apache.hadoop.hive.ql.exec.UDF类实现evaluate
自定义函数调用过程:
1.添加jar包(在hive命令行里面执行)
hive> add jar /root/NUDF.jar;
2.创建临时函数
hive> create temporary function getNation as 'cn.itcast.hive.udf.NationUDF';
3.调用
hive> select id, name, getNation(nation) from beauty;
4.将查询结果保存到HDFS中
hive> create table result row format delimited fields terminated by '\t' as select * from beauty order by id desc;
hive> select id, getAreaName(id) as name from tel_rec;
create table result row format delimited fields terminated by '\t' as select id, getNation(nation) from beauties;
自定义函数调用过程:
1.添加jar包(在hive命令行里面执行)
hive> add jar /root/NUDF.jar;
2.创建临时函数
hive> create temporary function getNation as 'cn.itcast.hive.udf.NationUDF';
3.调用
hive> select id, name, getNation(nation) from beauty;
4.将查询结果保存到HDFS中
hive> create table result row format delimited fields terminated by '\t' as select * from beauty order by id desc;
hive> select id, getAreaName(id) as name from tel_rec;
create table result row format delimited fields terminated by '\t' as select id, getNation(nation) from beauties;
阅读全文
0 0
- 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函数开发
- Hive内部自定义函数UDF
- hive 自定义函数UDF,UDAF
- Hive自定义函数(UDF、UDAF)
- Hive添加自定义UDF函数
- 基于TensorFlow的Cats vs. Dogs(猫狗大战)实现和详解(1)
- OSI,TCP/IP,五层协议的体系结构,以及各层协议
- java虚拟机规范---java虚拟机对class文件的限制
- 排序算法之冒泡排序
- deepin开发环境配置笔记
- Hive 自定义函数(UDF)开发
- windows远程桌面设置
- iOS
- 内存栅栏:软件高手的硬件观(三)
- spring配置文件命名空间插件springsource-tool-suite
- Android VR Player(全景视频播放器) [4]:侧滑菜单的实现
- 深刻分析有效值与均方根
- Android Camera Preview ANativeWindow的处理
- 算法谜题91 水平的和垂直的多米诺骨牌