write hive udf

I have written a function that hash partitions according to a certain column attribute, and it has passed the test in the daily environment
usage:
hive start
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 a temporary function:
create temporary function tisshare as 'com.dfire.tis.dump.hive.SharedRouter';
 
Invoke udf test in hive:
select tisshare('hello','search4totalpay','daily');
Function description, this function has a total of three parameters:
Parameter 1: a column attribute
Parameter 2: An index name in the corresponding partition tis
Parameter 3: Operating environment, daily use 'daily', online production environment 'online'
 
Required jar packages:
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
 
The attachment is the dependent jar package

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326969857&siteId=291194637