Created 07-28-2016 09:57 AM
hello all
I am very new to hadoop and I wanted to add a couple of jar files to be able to perform my queries
I tried using add jars and the path of the jars like I do in the terminal but I get an error
add jar /tmp/udfs/esri-geometry-api.jar /tmp/udfs/spatial-sdk-hadoop.jar;
Error while compiling statement: FAILED: ParseException line 4:0 cannot recognize input near 'add' 'jar' '/' [ERROR_STATUS]
since I am a newbie i dont exactly know how to add them since the path where the jars are located is right, and I am able to do that successfully on the terminal throught he back end.
Kindly if someone could elaborately explain me how to add these jar files, i would be eternally grateful
Created 07-28-2016 05:42 PM
Add semicolon at the end and make sure that your ambari user is mapped to an OS user that has access to the path
add jar /tmp/udfs/esri-geometry-api.jar;
add jar /tmp/udfs/spatial-sdk-hadoop.jar;
My suggestion is to place these libraries in HDFS with your Ambari user that has hdfs priviles. Such you can have access to the libraries from any node with hive client.
Example:
add jar hdfs://whateverhostname:8020/tmp/esri/esri-geometry-api.jar;
If the response addresses your problem, don't forget to vote and accept best answer. It is a stimulus for the effort. Thank you.
Created 07-28-2016 10:01 AM
Hi, can you please try to add those jars saparetly?
add jar /tmp/udfs/esri-geometry-api.jar
add jar /tmp/udfs/spatial-sdk-hadoop.jar
Created 07-28-2016 10:04 AM
Hi, Thanks
I tried to do so, still showing the same error..
Created 07-28-2016 10:11 AM
ok, then you can also put these required jars inside hive.aux.jars.path through ambari hive conf, jars will get picked automatically.
Created 07-28-2016 10:59 AM
Hi jitendra,
So i set this property on custom hive-server2 as hive.aux.jars.path and the path right??
and do i have to set 2 different properties for both the jars or use a ',' to seperate both the jars in a single property?
Created 07-28-2016 11:11 AM
mkdir /usr/hdp/current/hive-server2/auxlib/ on HS2 node.
copy required jars to /usr/hdp/current/hive-server2/auxlib/ loaction.
Added below property into custom hive-server2 and restart the all affected services. And see if that help.
<property>
<name>hive.aux.jars.path</name>
<value>/usr/hdp/current/hive-server2/auxlib/</value>
</property>
Created 07-28-2016 11:39 AM
hi Jitendra,
Tried to do as you said
when I tried to execute the query say select * from test.building i got the error
Error while compiling statement: FAILED: RuntimeException java.lang.ClassNotFoundException: com.esri.json.hadoop.UnenclosedJsonInputFormat [ERROR_STATUS]
Created 07-28-2016 11:59 AM
Looks like it still didn't picked the jar file, lets try another approach.
In hive-env.sh file through Ambari.
export HIVE_AUX_JARS_PATH=<jar1 file path>,<jar2 file path>
And restart the services.
Created 07-28-2016 01:05 PM
Did you mean hive-env template in advance hive-env?
Created 07-28-2016 01:11 PM
Yes, under same location. just after below line
"# Folder containing extra libraries required for hive compilation/execution can be controlled by: