Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add SerDe jar

Tags:

hadoop

hive

I use Hive to create table store sequencefile. Row format is serder class myserde.TestDeserializer in hiveserde-1.0.jar

In the command line I use this command to add the jar file:

hive ADD JAR hiveserde-1.0.jar

Then I create a table, the file loads successfully.

But now I want to run it and create a table on the client by using mysql jdbc. The error is :

SerDe: myserde.TestDeserializer does not exist.

How to run it ? Thanks

like image 741
cldo Avatar asked Dec 25 '12 18:12

cldo


1 Answers

So, there are a few options. In all of them the jar needs to be present on your cluster with Hive installed. The JDBC client code, of course, can be run from anywhere within or outside of the cluster.

Option 1: You issue a HQL query before you run any of your other HQL commands:

ADD JAR hiveserde-1.0.jar

Option 2: You can update your hive-site.xml to have the hive.aux.jars.path property set to the complete path to your jar hiveserde-1.0.jar

like image 95
Mark Grover Avatar answered Oct 16 '22 23:10

Mark Grover