问题1:
- Caused by: javax.jdo.JDODataStoreException: Required table missing : "`VERSION`" in Catalog "" Schema "". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.autoCreateTables"
- NestedThrowables:
- org.datanucleus.store.rdbms.exceptions.MissingTableException: Required table missing : "`VERSION`" in Catalog "" Schema "". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.autoCreateTables"
- at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:461)
- at org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:732)
- at org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:752)
- at org.apache.hadoop.hive.metastore.ObjectStore.setMetaStoreSchemaVersion(ObjectStore.java:6664)
查看并跟踪hive的源码得出
- if ((this.readOnlyDatastore) || (this.fixedDatastore))
- {
- this.autoCreateTables = false;
- this.autoCreateColumns = false;
- this.autoCreateConstraints = false;
- }
- else
- {
- boolean autoCreateSchema = conf.getBooleanProperty("datanucleus.autoCreateSchema");
- if (autoCreateSchema)
- {
- this.autoCreateTables = true;
- this.autoCreateColumns = true;
- this.autoCreateConstraints = true;
- }
- else
- {
- this.autoCreateColumns = conf.getBooleanProperty("datanucleus.autoCreateColumns");
- this.autoCreateTables = conf.getBooleanProperty("datanucleus.autoCreateTables");
- this.autoCreateConstraints = conf.getBooleanProperty("datanucleus.autoCreateConstraints");
- }
- }
- this.readOnlyDatastore = conf.getBooleanProperty("datanucleus.readOnlyDatastore");
- this.fixedDatastore = conf.getBooleanProperty("datanucleus.fixedDatastore");
- <property>
- <name>datanucleus.readOnlyDatastore</name>
- <value>false</value>
- </property>
- <property>
- <name>datanucleus.fixedDatastore</name>
- <value>false</value>
- </property>
- <property>
- <name>datanucleus.autoCreateSchema</name>
- <value>true</value>
- </property>
- <property>
- <name>datanucleus.autoCreateTables</name>
- <value>true</value>
- </property>
- <property>
- <name>datanucleus.autoCreateColumns</name>
- <value>true</value>