DevTech101

DevTech101

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

hive.aux.jars.path
Get the JSONSerDe compiled jar file from the below link

http://www.congiu.net/hive-json-serde/1.3.7/cdh5/
Get the source from the below link and compile your self
https://github.com/rcongiu/Hive-JSON-Serde

How to compile the java library

Get the JSONSerDe java source from
https://github.com/cloudera/cdh-twitter-example/blob/master/hive-serdes/src/main/java/com/cloudera/hive/serde/JSONSerDe.java

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/JSONSerDe.java

# Create the jar
cd /var/tmp/
mkdir temp; cd temp
jar -cvf ../JSONSerDe.jar *
cp JSONSerDe.jar /opt/cloudera/parcels/CDH/lib/hive/lib/.
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
%d bloggers like this: