Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding hive jars permanently

Tags:

hadoop

hive

Is there any way I can add hive jars permanently instead of adding at session level in hive shell?

Any help would be appreciated

like image 586
chhaya vishwakarma Avatar asked Aug 04 '15 07:08

chhaya vishwakarma


1 Answers

In the hiveserver2 host, create a location something like /var/lib/hive and add all the necessary jars inside that folder. Edit the hive-site.xml and mention all these jars in the property hive.aux.jars.path

Eg: ADD JAR /home/amal/hive/amaludf.jar ADD JAR /home/amal/hive/amaludf2.jar

Instead of using the above commands in each session, you can define it for all sessions.

Create a location for storing these jars in the hiveserver host.

mkdir /var/lib/hive

Add all these jars to that directory

Set the property in hive-site.xml

<property>
  <name>hive.aux.jars.path</name>
  <value>/var/lib/hive</value>
</property>

Restart the hiveserver2 after doing this modification.

Instead of creating a directory and putting all the jars, you can specify paths of individual jars also. The only condition is that all these jars should be present in the hiveserver host.

Eg:

<property>
  <name>hive.aux.jars.path </name>
  <value>file:///home/amal/hive/udf1.jar,file:///usr/lib/hive/lib/hive-hbase-handler.jar</value>
</property>
like image 69
Amal G Jose Avatar answered Nov 04 '22 10:11

Amal G Jose