Hive hadoop jar files conflicts for custom UDF/Serde
I have faced this problem very often and it take long time figure to resolve libraries conflicts.
As Hadoop Map reduce libraries gets preferences when you launch Mapreduce job or hive lanuch mapreduce job and suppose your custom library required latest version of jars whose older version is already present in Hadoop class path. Even you add your jars hive class path or auxiliary class path this issue still occur.
Steps to resolve such libraries conflicts.
- Add jar to Hadoop class path-
- Next launch hive command with Auxiliary path library. check my post on hive aux class path issue aux path.
- In case of mapreduce job, also add your libraries to HADOOP_TASKTRACKER_OPTS
You can also add jars to map reduce class path by adding class to mapreduce job builder-
Job job = new Job(conf); job.setJarByClass(<any class from third party jar file>.class); </any>
- If required set below properties to true in hive-
set mapreduce.task.classpath.first=true; set mapreduce.job.user.classpath.first=true;