How to load/add a jar file in Hive – Installing JSONSerDe in a CDH environment

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

How to install, configure Json capability in CDH distribution

The Cloudera(CDH) distribution is not coming with json capability, in order to use that you will need to add/install your own

There are 3 options to add/load a jar file if you use the cloudera(CDH) distribution

Get the JSONSerDe compiled jar file from the below link
Get the source from the below link and compile your self

How to compile the java library

Get the JSONSerDe java source from

Now compile the java library
cd /opt/cloudera/parcels/CDH/lib/hive/lib
cl_path=`ls |perl -p -i -e 's,\n,:,'`
cd /usr/share/cmf/lib/cdh5/
cl_path2=`ls |perl -p -i -e 's,\n,:/usr/share/cmf/lib/cdh5/,'`
cd /opt/cloudera/parcels/CDH/lib/hive/lib
javac -classpath $cl_path2:$cl_path /var/tmp/

# Create the jar
cd /var/tmp/
mkdir temp; cd temp
jar -cvf ../JSONSerDe.jar *
cp JSONSerDe.jar /opt/cloudera/parcels/CDH/lib/hive/lib/.

Leave a Reply

Notify of