编写hive udf
我已经编写好了一个根据某列属性hash分区的一个函数,并且已经在日常环境中测试通过
用法:
hive 启动
hive --auxpath /root/standalone/commons-io-2.3.jar,/root/standalone/commons-logging-1.2.jar,/root/standalone/fastjson-1.1.41.jar,/root/standalone/global-diamond-config-1.0.3-SNAPSHOT.jar,/root/standalone/hive-exec-1.1.0.jar,/root/standalone/noggit-0.6.jar,/root/standalone/slf4j-api-1.7.5.jar,/root/standalone/solr-solrj-5.3.0.jar,/root/standalone/spring-2.5.6.jar,/root/standalone/terminator-manage-pojo-1.0.3-SNAPSHOT.jar,/root/standalone/tis-client-standalone-1.0.3-SNAPSHOT.jar,/root/standalone/tis-solrj-client-1.0.3-SNAPSHOT.jar,/root/standalone/zookeeper-3.4.5.jar
创建临时函数:
create temporary function tisshare as 'com.dfire.tis.dump.hive.SharedRouter';
在hive中调用udf测试:
select tisshare('hello','search4totalpay','daily');
函数说明,此函数一共三个参数:
参数1:某列属性
参数2:对应分区tis中的某个索引名称
参数3:运行环境,日常使用‘daily’,线上生产环境'online'
需要依赖的jar包:
commons-io-2.3.jar
commons-logging-1.2.jar
fastjson-1.1.41.jar
global-diamond-config-1.0.3-SNAPSHOT.jar
hive-exec-1.1.0.jar
noggit-0.6.jar
slf4j-api-1.7.5.jar
solr-solrj-5.3.0.jar
spring-2.5.6.jar
terminator-manage-pojo-1.0.3-SNAPSHOT.jar
tis-client-standalone-1.0.3-SNAPSHOT.jar
tis-solrj-client-1.0.3-SNAPSHOT.jar
zookeeper-3.4.5.jar
commons-logging-1.2.jar
fastjson-1.1.41.jar
global-diamond-config-1.0.3-SNAPSHOT.jar
hive-exec-1.1.0.jar
noggit-0.6.jar
slf4j-api-1.7.5.jar
solr-solrj-5.3.0.jar
spring-2.5.6.jar
terminator-manage-pojo-1.0.3-SNAPSHOT.jar
tis-client-standalone-1.0.3-SNAPSHOT.jar
tis-solrj-client-1.0.3-SNAPSHOT.jar
zookeeper-3.4.5.jar
附件中是依赖的jar包
相关推荐
周公周金桥 2020-09-06
大象从不倒下 2020-07-31
AlisaClass 2020-07-19
MaureenChen 2020-04-21
xingguanghai 2020-03-13
teresalxm 2020-02-18
木四小哥 2013-05-14
SoShellon 2013-06-01
Simagle 2013-05-31
羽化大刀Chrome 2013-05-31
waterv 2020-01-08
LutosX 2013-07-29
vanturman 2013-06-27
wutongyuq 2013-04-12
luoqu 2013-04-10
ChinaWin 2020-08-13
kangtingting0 2020-05-20
MichelinMessi 2020-02-19