Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding/Defining Jars in Hive permanently

I was trying to add a jar in Hive classpath using below add command.

Command: hive> add myjar.jar

but whenever i login to hive, i need to add myjar.jar using add cmd. Is there any way I can add it permanently in Hive Classpath.

Regards, Mohammed Niaz

like image 809
Mohammed Niaz Avatar asked Jun 27 '14 05:06

Mohammed Niaz


People also ask

How do I permanently add a jar to hive?

create directory named auxlib in $HIVE_HOME, put all your jars in this directory and restart the hive server. run ps -ef | grep hive this command to list hive processes, search for hive. aux. jars.

How do you remove a jar from hive?

Use DELETE command: DELETE { FILE[S] | JAR[S] | ARCHIVE[S] } [<filepath1> <filepath2> ..]


2 Answers

add this to your .hiverc file

  add jar myjar.jar

have a look at this if you require further info

http://hadooped.blogspot.in/2013/08/hive-hiverc-file.html

like image 183
dpsdce Avatar answered Oct 29 '22 01:10

dpsdce


In order to add them permanently recommended ways are as follows.

  1. add in hive-site.xml

    <property> <name>hive.aux.jars.path</name> <value>file://localpath/yourjar.jar</value> </property>

  2. Copy and paste the JAR file to the ${HIVE_HOME}/auxlib/ folder

    Source: Apache hive essentials book

like image 36
Dhruv Kapatel Avatar answered Oct 29 '22 01:10

Dhruv Kapatel