Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 05-31-2016 12:48 PM
I have written one Avro ser/des library for Hive to read/write Avro binary data file, which does not contain the Avro schema. And I copied this library into $HIVE/lib.
When I query the Hive external table, which uses my customized ser/des library, (e.g., select * from user_avro), it works as expected.
However if I insert data into that Hive external table like "INSERT OVERWRITE TABLE user_avro SELECT * FROM user), it complains that the my customized ser/des class cannot be found.
This output difference from Hive console is that the second one is launching MapReduce job.
Does anyone know where I need to copy this customized ser/des library except $HIVE/lib?
Many thanks in advance.
Created 05-31-2016 01:35 PM
@yong yang apart from adding jars at each session level as suggested by @Jitendra Yadav you can add them permanently using hive.aux.jars.path
<property>
<name>hive.aux.jars.path</name>
<value>/var/lib/hive</value>
</property>
Created 05-31-2016 01:10 PM
Try using below command on hive shell before executing insert command.
hive> add jar '\your jar file path';
Created 05-31-2016 01:35 PM
@yong yang apart from adding jars at each session level as suggested by @Jitendra Yadav you can add them permanently using hive.aux.jars.path
<property>
<name>hive.aux.jars.path</name>
<value>/var/lib/hive</value>
</property>
Created 05-31-2016 03:31 PM
Thanks you very much for your reply. Based on your suggestions, I have added the following into hive-env.sh through Ambari Hive configuration interface:
export HIVE_AUX_JARS_PATH=<my jar full path>
and then restart the hive.
Now it works as expected in both Hive console and Hue BeesWax UI.
Many thanks again.