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
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/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.
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.
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?
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>
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]
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.