The error message is as follows:
Failed:execution Error, return code 1 from Org.apache.hadoop.hive.ql.exec.DDLTask. Metaexception (Message:javax.jdo.JDODataStoreException:An exception is thrown while Adding/validating class (es): Specified key was too long; Max key length is 767 bytescom.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:Specified key was too long; Max key length is 767 bytes at sun.reflect.GeneratedConstructorAccessor28.newInstance (Unknown Source) at Sun . reflect. Delegatingconstructoraccessorimpl.newinstance (delegatingconstructoraccessorimpl.java:45) at Java.lang.reflect.Constructor.newInstance (constructor.java:526) at Com.mysql.jdbc.Util.handleNewInstance ( util.java:411) at Com.mysql.jdbc.Util.getInstance (util.java:386) at Com.mysql.jdbc.SQLError.createSQLExcepti On (sqlerror.java:1054) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:4120) at Com.mysql.jdbc.Mysql Io.checkerrorpacket (mysqlio.java:4052) at Com.mysql.jdbc.mysqlio.sEndcommand (mysqlio.java:2503) at Com.mysql.jdbc.MysqlIO.sqlQueryDirect (mysqlio.java:2664) at Com.mysql.jdbc. Connectionimpl.execsql (connectionimpl.java:2809) at Com.mysql.jdbc.ConnectionImpl.execSQL (Connectionimpl.java : 2758) at Com.mysql.jdbc.StatementImpl.execute (statementimpl.java:894) at COM.MYSQL.JDBC.STATEMENTIMPL.EXECU Te (statementimpl.java:732) at Com.jolbox.bonecp.StatementHandle.execute (statementhandle.java:254) at Org.dat Anucleus.store.rdbms.table.AbstractTable.executeDdlStatement (abstracttable.java:760) at Org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatementList (abstracttable.java:711) at Org.datanucleus.store.rdbms.table.AbstractTable.create (abstracttable.java:425) at Org.datanucleus.store.rdbms.table.AbstractTable.exists (abstracttable.java:488) at Org.datanucleus.store.rdbms.rdbmsstoremanager$classadder.performtablesvalidation (RDBMSStoreManager.java:3380) At Org.datanucleus.stoRe.rdbms.rdbmsstoremanager$classadder.addclasstablesandvalidate (rdbmsstoremanager.java:3190) at Org.datanucleus.store.rdbms.rdbmsstoremanager$classadder.run (rdbmsstoremanager.java:2841) at Org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute (abstractschematransaction.java:122) at Org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses (rdbmsstoremanager.java:1605) at Org.datanucleus.store.AbstractStoreManager.addClass (abstractstoremanager.java:954) at Org.datanucleus.store.rdbms.RDBMSStoreManager.getDatastoreClass (rdbmsstoremanager.java:679) at Org.datanucleus.store.rdbms.RDBMSStoreManager.getPropertiesForGenerator (rdbmsstoremanager.java:2045) at Org.datanucleus.store.AbstractStoreManager.getStrategyValue (abstractstoremanager.java:1365) at Org.datanucleus.ExecutionContextImpl.newObjectId (executioncontextimpl.java:3827) at Org.datanucleus.state.JDOStateManager.setIdentity (jdostatemanager.java:2571) at Org.datAnucleus.state.JDOStateManager.initialiseForPersistentNew (jdostatemanager.java:513) at Org.datanucleus.state.ObjectProviderFactoryImpl.newForPersistentNew (objectproviderfactoryimpl.java:232) at Org.datanucleus.ExecutionContextImpl.newObjectProviderForPersistentNew (executioncontextimpl.java:1414) at Org.datanucleus.ExecutionContextImpl.persistObjectInternal (executioncontextimpl.java:2218) at Org.datanucleus.ExecutionContextImpl.persistObjectWork (executioncontextimpl.java:2065) at Org.datanucleus.ExecutionContextImpl.persistObject (executioncontextimpl.java:1913) at Org.datanucleus.ExecutionContextThreadedImpl.persistObject (executioncontextthreadedimpl.java:217) at Org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent (jdopersistencemanager.java:727) at Org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent (jdopersistencemanager.java:752) at Org.apache.hadoop.hive.metastore.ObjectStore.createTable (Objectstore.java:814) at Sun.reflect.GeneratedMethodAccessor32.invoke (Unknown Source) at sun.reflect.DelegatingMethodAcces Sorimpl.invoke (delegatingmethodaccessorimpl.java:43) at Java.lang.reflect.Method.invoke (method.java:606) at Org.apache.hadoop.hive.metastore.RawStoreProxy.invoke (rawstoreproxy.java:114) at com.sun.proxy.$ Proxy0.createtable (Unknown Source) at Org.apache.hadoop.hive.metastore.hivemetastore$hmshandler.create_table_core (hivemetastore.java:1416) at Org.apache.hadoop.hive.metastore.hivemetastore$hmshandler.create_table_with_ Environment_context (hivemetastore.java:1449)
The solution is to run MySQL as the root user.
Then enter:
ALTER DATABASE hive character set latin1;
Do not change in the/ETC/MY.CF, where the modification does not take effect.
Hive CREATE table times wrong, Specified Key was too long; Max key length is 767 bytes