Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hive doesn't work on install

Tags:

hadoop

hive

I get the following error in Hive when executing any command.

hive> show tables;
FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
NestedThrowables:
java.lang.reflect.InvocationTargetException
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

This is in the hive.log.

2011-07-27 19:10:57,526 ERROR exec.DDLTask (SessionState.java:printError(343)) - FAILED: Error in metadata: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
NestedThrowables:
java.lang.reflect.InvocationTargetException
org.apache.hadoop.hive.ql.metadata.HiveException: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
NestedThrowables:
java.lang.reflect.InvocationTargetException
        at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1028)
        at org.apache.hadoop.hive.ql.metadata.Hive.databaseExists(Hive.java:1013)
        at org.apache.hadoop.hive.ql.exec.DDLTask.showTables(DDLTask.java:1691)
        at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:289)
        at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:130)
        at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57)
        at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1063)
        at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:900)
        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:748)
        at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:164)
        at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:241)
        at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:456)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
Caused by: javax.jdo.JDOFatalInternalException: Unexpected exception caught.
NestedThrowables:
java.lang.reflect.InvocationTargetException
        at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1186)
        at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:803)
        at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698)
        at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:234)
        at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:261)
        at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:196)
        at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:171)
        at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62)
        at org.datanucleus.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:255)
        at org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:182)
        ... 41 more

There is clearly a problem with the metadatabase, but the error is quite obtuse and the installation guide doesn't say anything about configuring the metadatabase.

like image 505
schmmd Avatar asked Jul 28 '11 02:07

schmmd


2 Answers

I was having the same problem.
The solutions is to download this file: https://www.mysql.com/downloads/connector/j/, unzip it, copy jar from inside to location: /usr/lib/hive/lib (might be different in your case - this is where the hive libs are located)

like image 168
wlk Avatar answered Oct 13 '22 01:10

wlk


I found the answer here:

http://getsatisfaction.com/cloudera/topics/hive_error_error_in_metadata_javax_jdo_jdofatalinternalexception

"Shirish Reddy: delete $HADOOP_HOME/build and every thing should be fine . reply copied from Zheng"

Strangely enough, after deleting $HADOOP_HOME/build the problem went away.

like image 45
schmmd Avatar answered Oct 13 '22 01:10

schmmd