Hive exception: Specified key was too long when MySQL was created; Max key length is bytes

Source: Internet
Author: User

2015-11-13 14:44:44,681 ERROR [main]: Datanucleus.datastore (Log4JLogger.java:error ())-an exception is thrown while Adding/validating Class (es): Specified key was too long; Max key length is bytes
Com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:Specified key was too long; Max key length is bytes
At Sun.reflect.GeneratedConstructorAccessor21.newInstance (Unknown Source)
At Sun.reflect.DelegatingConstructorAccessorImpl.newInstance (delegatingconstructoraccessorimpl.java:45)
At Java.lang.reflect.Constructor.newInstance (constructor.java:422)
At Com.mysql.jdbc.Util.handleNewInstance (util.java:389)
At Com.mysql.jdbc.Util.getInstance (util.java:372)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:980)
At Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:3835)
At Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:3771)
At Com.mysql.jdbc.MysqlIO.sendCommand (mysqlio.java:2435)
At Com.mysql.jdbc.MysqlIO.sqlQueryDirect (mysqlio.java:2582)
At Com.mysql.jdbc.ConnectionImpl.execSQL (connectionimpl.java:2531)
At Com.mysql.jdbc.ConnectionImpl.execSQL (connectionimpl.java:2489)
At Com.mysql.jdbc.StatementImpl.execute (statementimpl.java:848)
At Com.mysql.jdbc.StatementImpl.execute (statementimpl.java:742)
At Com.jolbox.bonecp.StatementHandle.execute (statementhandle.java:254)
At Org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatement (abstracttable.java:760)
At Org.datanucleus.store.rdbms.table.TableImpl.createIndices (tableimpl.java:648)
At Org.datanucleus.store.rdbms.table.TableImpl.createConstraints (tableimpl.java:422)
At Org.datanucleus.store.rdbms.rdbmsstoremanager$classadder.performtablesvalidation (RDBMSStoreManager.java:3459 )
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.query.RDBMSQueryUtils.getStatementForCandidates (rdbmsqueryutils.java:408)
At Org.datanucleus.store.rdbms.query.JDOQLQuery.compileQueryFull (jdoqlquery.java:947)
At Org.datanucleus.store.rdbms.query.JDOQLQuery.compileInternal (jdoqlquery.java:370)
At Org.datanucleus.store.query.Query.executeQuery (query.java:1744)
At Org.datanucleus.store.query.Query.executeWithArray (query.java:1672)
At Org.datanucleus.api.jdo.JDOQuery.executeWithArray (jdoquery.java:312)
At Org.apache.hadoop.hive.metastore.ObjectStore.listPrincipalGlobalGrants (objectstore.java:4403)
At Org.apache.hadoop.hive.metastore.ObjectStore.grantPrivileges (objectstore.java:3937)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:62)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43)
At Java.lang.reflect.Method.invoke (method.java:497)
At Org.apache.hadoop.hive.metastore.RawStoreProxy.invoke (rawstoreproxy.java:114)
At Com.sun.proxy. $Proxy 7.grantPrivileges (Unknown Source)
At Org.apache.hadoop.hive.metastore.hivemetastore$hmshandler.createdefaultroles_core (HiveMetaStore.java:679)
At Org.apache.hadoop.hive.metastore.hivemetastore$hmshandler.createdefaultroles (HiveMetaStore.java:648)
At Org.apache.hadoop.hive.metastore.hivemetastore$hmshandler.init (hivemetastore.java:462)
At Org.apache.hadoop.hive.metastore.retryinghmshandler.<init> (retryinghmshandler.java:66)
At Org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy (retryinghmshandler.java:72)
At Org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler (hivemetastore.java:5762)
At Org.apache.hadoop.hive.metastore.hivemetastoreclient.<init> (hivemetastoreclient.java:199)
At Org.apache.hadoop.hive.ql.metadata.sessionhivemetastoreclient.<init> (Sessionhivemetastoreclient.java : 74)
At Sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
At Sun.reflect.NativeConstructorAccessorImpl.newInstance (nativeconstructoraccessorimpl.java:62)
At Sun.reflect.DelegatingConstructorAccessorImpl.newInstance (delegatingconstructoraccessorimpl.java:45)
At Java.lang.reflect.Constructor.newInstance (constructor.java:422)
At Org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance (metastoreutils.java:1521)
At Org.apache.hadoop.hive.metastore.retryingmetastoreclient.<init> (retryingmetastoreclient.java:86)
At Org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy (retryingmetastoreclient.java:132)
At Org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy (retryingmetastoreclient.java:104)
At Org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient (hive.java:3005)
At Org.apache.hadoop.hive.ql.metadata.Hive.getMSC (hive.java:3024)
At Org.apache.hadoop.hive.ql.session.SessionState.start (sessionstate.java:503)
At Org.apache.hive.service.cli.CLIService.applyAuthorizationConfigPolicy (cliservice.java:127)
At Org.apache.hive.service.cli.CLIService.init (cliservice.java:112)
At Org.apache.hive.service.CompositeService.init (compositeservice.java:59)
At Org.apache.hive.service.server.HiveServer2.init (hiveserver2.java:100)
At Org.apache.hive.service.server.HiveServer2.startHiveServer2 (hiveserver2.java:345)
At org.apache.hive.service.server.hiveserver2.access$700 (hiveserver2.java:74)
At Org.apache.hive.service.server.hiveserver2$startoptionexecutor.execute (hiveserver2.java:588)
At Org.apache.hive.service.server.HiveServer2.main (hiveserver2.java:461)
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:62)
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43)
At Java.lang.reflect.Method.invoke (method.java:497)
At Org.apache.hadoop.util.RunJar.run (runjar.java:221)
At Org.apache.hadoop.util.RunJar.main (runjar.java:136)

Solve

Change MySQL DB encoding from UTF8 to Latin1

Hive Exception: Specified key was too long when MySQL was created, max key length is bytes

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.