Specified key was too long; max key length is 767 bytes

启动hive后运行:SHOW TABLES 报错

hive> show tables;

FAILED: Error in metadata: MetaException(message:Got exception: javax.jdo.JDODataStoreException An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 767 bytes

com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)

at com.mysql.jdbc.Connection.execSQL(Connection.java:3170)

at com.mysql.jdbc.Connection.execSQL(Connection.java:3099)

at com.mysql.jdbc.Statement.execute(Statement.java:695)

at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)

at org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatement(AbstractTable.java:730)

at org.datanucleus.store.rdbms.table.AbstractTable.executeDdlStatementList(AbstractTable.java:681)

at org.datanucleus.store.rdbms.table.AbstractTable.create(AbstractTable.java:402)

at org.datanucleus.store.rdbms.table.AbstractTable.exists(AbstractTable.java:458)

at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.performTablesValidation(RDBMSStoreManager.java:2689)

at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTablesAndValidate(RDBMSStoreManager.java:2503)

at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2148)

at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:113)

at org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses(RDBMSStoreManager.java:986)

at org.datanucleus.store.rdbms.RDBMSStoreManager.addClasses(RDBMSStoreManager.java:952)

at org.datanucleus.store.AbstractStoreManager.addClass(AbstractStoreManager.java:919)

at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass(MappedStoreManager.java:356)

at org.datanucleus.store.rdbms.query.legacy.ExtentHelper.getExtent(ExtentHelper.java:48)

at org.datanucleus.store.rdbms.RDBMSStoreManager.getExtent(RDBMSStoreManager.java:1332)

at org.datanucleus.ObjectManagerImpl.getExtent(ObjectManagerImpl.java:4149)

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.getTables(ObjectStore.java:747)

at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler$30.run(HiveMetaStore.java:1735)

at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler$30.run(HiveMetaStore.java:1732)

at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.executeWithRetry(HiveMetaStore.java:307)

at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_tables(HiveMetaStore.java:1732)

at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getTables(HiveMetaStoreClient.java:698)

at org.apache.hadoop.hive.ql.metadata.Hive.getTablesByPattern(Hive.java:918)

at org.apache.hadoop.hive.ql.metadata.Hive.getAllTables(Hive.java:892)

at org.apache.hadoop.hive.ql.exec.DDLTask.showTables(DDLTask.java:1721)

at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:289)

at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:131)

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:209)

at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:286)

at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:516)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at org.apache.hadoop.util.RunJar.main(RunJar.java:156)

)

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

问题是数据库的字符集问题

解决方法:

alter database hive character set latin1;

时间: 2024-08-29 19:00:49

Specified key was too long; max key length is 767 bytes的相关文章

Laravel 5.4 migrate报错:Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `us ers_email_unique`(`email`))

Laravel 5.4 migrate报错:Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `us     ers_email_unique`(`email`)) public function up() { Schema::create('users', function (Blu

Hive集成Mysql作为元数据时,提示错误:Specified key was too long; max key length is 767 bytes

在进行Hive集成Mysql作为元数据过程中,做完所有安装配置工作后,进入到hive模式,执行show databases:执行正常,接着执行show tables:时却报错. 关键错误信息如下: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes) 具体操作信息如下: hive> show databases; OK

Specified key was too long; max key length is 767 bytes mysql

Specified key was too long; max key length is 767 bytes 说明: 执行当前 Web 请求期间,出现未经处理的异常.请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息. 异常详细信息: MySql.Data.MySqlClient.MySqlException: Specified key was too long; max key length is 767 bytes 给Context增加如下的注解 [DbConfigu

执行nova-manage db sync时出错,提示’Specified key was too long; max key length is 1000 bytes’

执行nova-manage db sync时出错: 2012-03-24 14:07:01 CRITICAL nova [-] (OperationalError) (1071, ‘Specified key was too long; max key length is 1000 bytes’) ‘\nCREATE TABLE user_project_association (\n\tcreated_at DATETIME, \n\tupdated_at DATETIME, \n\tdele

Hive创建表时报错,Specified key was too long; max key length is 767 bytes

报错信息如下: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:javax.jdo.JDODataStoreException: An exception was thrown while adding/validating class(es) : Specified key was too long; max key length

hive报错: Specified key was too long; max key length is 767 bytes

DataNucleus.Datastore (Log4JLogger.java:error(115)) - An exception was 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

hive异常:创建MySQL时Specified key was too long; max key length is 1000 bytes

2015-11-13 14:44:44,681 ERROR [main]: DataNucleus.Datastore (Log4JLogger.java:error(115)) - An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 1000 bytescom.mysql.jdbc.exceptions.jdbc4.MySQLSynta

ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes

今天在MySQL 5.6版本的数据库中修改InnoDB表字段长度时遇到了"ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes"错误,第一次遇到这个错误,遂花了点学习.研究过.总结这个问题. 我们先来创建一个测试表,构造这样的错误. mysql> use MyDB; Reading table information for completion of table and colum

laravel报错1071 Specified key was too long; max key length is 1000 bytes

Laravel 默认使用utf8mb4字符编码,而不是的utf8编码.因此运行php artisan migrate会出现如下错误: [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique