Closed lalaguozhe closed 11 years ago
参考https://issues.apache.org/jira/browse/HIVE-1841
完整的异常栈信息如下:
2013-02-19 12:18:32,114 ERROR ql.Driver (SessionState.java:printError(380)) - FAILED: Error in semantic analysis: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fe
tch table dpodssec_cs_contact
org.apache.hadoop.hive.ql.parse.SemanticException: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch table dpodssec_cs_contact
at org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.analyzePrivilegeObject(DDLSemanticAnalyzer.java:514)
at org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.analyzeGrant(DDLSemanticAnalyzer.java:454)
at org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.analyzeInternal(DDLSemanticAnalyzer.java:357)
at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:243)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:430)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:337)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:898)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:255)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:212)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:338)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:637)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:554)
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: org.apache.hadoop.hive.ql.metadata.HiveException: Unable to fetch table dpodssec_cs_contact
at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:909)
at org.apache.hadoop.hive.ql.metadata.Hive.getTable(Hive.java:843)
at org.apache.hadoop.hive.ql.parse.DDLSemanticAnalyzer.analyzePrivilegeObject(DDLSemanticAnalyzer.java:505)
... 17 more
Caused by: javax.jdo.JDODataStoreException: Exception thrown obtaining schema column information from datastore
NestedThrowables:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'hive8.DELETEME1361247511797' doesn't exist
at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:313)
at org.datanucleus.ObjectManagerImpl.getExtent(ObjectManagerImpl.java:4154)
at org.datanucleus.store.rdbms.query.legacy.JDOQLQueryCompiler.compileCandidates(JDOQLQueryCompiler.java:411)
at org.datanucleus.store.rdbms.query.legacy.QueryCompiler.executionCompile(QueryCompiler.java:312)
at org.datanucleus.store.rdbms.query.legacy.JDOQLQueryCompiler.compile(JDOQLQueryCompiler.java:225)
at org.datanucleus.store.rdbms.query.legacy.JDOQLQuery.compileInternal(JDOQLQuery.java:175)
at org.datanucleus.store.query.Query.executeQuery(Query.java:1628)
at org.datanucleus.store.rdbms.query.legacy.JDOQLQuery.executeQuery(JDOQLQuery.java:245)
at org.datanucleus.store.query.Query.executeWithArray(Query.java:1499)
at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:243)
at org.apache.hadoop.hive.metastore.ObjectStore.getMDatabase(ObjectStore.java:389)
at org.apache.hadoop.hive.metastore.ObjectStore.getDatabase(ObjectStore.java:408)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB_core(HiveMetaStore.java:492)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.access$300(HiveMetaStore.java:141)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler$5.run(HiveMetaStore.java:514)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler$5.run(HiveMetaStore.java:511)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.executeWithRetry(HiveMetaStore.java:367)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:511)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:273)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.
通过修改以下两个配置,解决这个问题。 datanucleus.autoCreateSchema=false datanucleus.fixedDatastore=true
hive如果同时执行hive语句比如create table或者grant语句会报错com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'hive8.DELETEME1356611646373' doesn't exist,这时因为hive默认datanucleus配置会在每次在mysql中创建一个deleteme表,然后删除来来得到schema 和 catalog信息,当并发量大的情况下,会生成相同名字的表,而第一个instance删除表后,当第二个instance要删除相同表的时候会抛出 table doesn't exist,这样导致整个操作失败,我查了下资料可以通过设置 datanucleus.autoCreateSchema=false datanucleus.fixedDatastore=true 来解决这个问题,但是修改后可能会导致不能创建元数据,所以有的人会配置两套配置,分别对应开发人员和使用人员,我们需要测试一下