情况描述

Hive建表时报错,元数据存储在mysql中。

报错信息

如下:

FAILED: Execution Error, return code  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 is  bytes
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is bytes
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
at java.lang.reflect.Constructor.newInstance(Constructor.java:)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.Util.getInstance(Util.java:)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:)
at com.jolbox.bonecp.StatementHandle.execute(StatementHandle.java:)

解决方法:

修改数据库编码,在mysql机器的上命令行中运行:

alter database hive character set latin1;

hive建表报错:Specified key was too long; max key length is 767 bytes,hadoophive的更多相关文章

  1. hive mysql元数据,报错 Specified key was too long; max key length is 767 bytes

    Specified key was too long; max key length is 767 bytes 此错误为hive 元数据mysql 字符集编码问题 如 show create tabl ...

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

    废话不多说,报错如下: DataNucleus.Datastore (Log4JLogger.java:error(115)) - An exception was thrown while addi ...

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

    在进行Hive集成Mysql作为元数据过程中.做全然部安装配置工作后.进入到hive模式,运行show databases.运行正常,接着运行show tables:时却报错. 关键错误信息例如以下: ...

  4. laravel migrate时报错:Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

    今天在学习laravel的路由模型绑定时,在按照文档执行php artisan migrate时报错. In Connection.php line 664: SQLSTATE[42000]: Syn ...

  5. 导入sql文件报错:1071 Specified key was too long; max key length is 767 bytes

    ref: https://stackoverflow.com/questions/1814532/1071-specified-key-was-too-long-max-key-length-is-7 ...

  6. 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 excep ...

  7. 【laravel5.4】php artisan migrate报错:Specified key was too long; max key length is 767 bytes

    1.原因:在进行 迁移文件生成时,程序并未给varchar类型字段设置 合适的长度,导致报错. 2.解决办法:找到database/ 目标迁移文件,修改其中类型为string的字段长度,建议不要超过2 ...

  8. 在hive执行创建表的命令,遇到异常com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes

    今天在练习hive的操作时,在创建数据表时,遇到了异常 FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.ex ...

  9. flask建表遇到的错误: flask,sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1071, 'Specified key was too long; max key length is 767 bytes')

    error:flask,sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1071, 'Specifie ...

随机推荐

  1. AC自动机相关Fail树和Trie图相关基础知识

    装载自55242字符串AC自动机专栏 fail树 定义 把所有fail指针逆向,这样就得到了一棵树 (因为每个节点的出度都为1,所以逆向后每个节点入度为1,所以得到的是一棵树) 还账- 有了这个东西, ...

  2. Module not found: Error: Can't resolve 'XXX' in 'XXXX'

    故障 控制台运行webpack/npm时出现 Module not found: Error: Can't resolve 'XXX' in 'XXXX' 解决方案 npm i XXX --save ...

  3. bzoj 4459: [Jsoi2013]丢番图 -- 数学

    4459: [Jsoi2013]丢番图 Time Limit: 10 Sec  Memory Limit: 64 MB Description 丢番图是亚历山大时期埃及著名的数学家.他是最早研究整数系 ...

  4. python网络编程(五)

    udp广播 #coding=utf-8 import socket, sys dest = ('<broadcast>', 7788) # 创建udp套接字 s = socket.sock ...

  5. websocket是什么

    websocket是什么? 这是知乎上面一个作者写的一篇风趣幽默又容易理解关于 websocket 的文章. 提供一下连接地址:https://www.zhihu.com/question/20215 ...

  6. python之面向对象的程序设计

    一.什么是面向对象的程序设计 面向过程的程序设计的核心是过程,过程即解决问题的步骤,面向过程的设计就好比精心设计好一条流水线,考虑周全什么时候处理什么东西. 优点是:极大的降低了程序的复杂度 缺点是: ...

  7. mysql:Cannot proceed because system tables used by Event Scheduler were found damaged at server start

    mysql 5.7.18 sqlyog访问数据库,查看表数据时,出现 Cannot proceed because system tables used by Event Scheduler were ...

  8. Linux软件开发常用的软件包(持续更新中)

    下面是Linux开发常用的软件包: 软件包的名称 作用描述 安装方式 build-essential   sudo apt-get install build-essential policycore ...

  9. yuv rgb 互转 公式 及算法

    1 前言 自然界的颜色千变万化,为了给颜色一个量化的衡量标准,就需要建立色彩空间模型来描述各种各样的颜色,由于人对色彩的感知是一个复杂的生理和心理联合作用的过程,所以在不同的应用领域中为了更好更准确的 ...

  10. netty源码解析目录

    第一章 java nio三大组件与使用姿势 二.netty使用姿势 三.netty服务端启动源码 四.netty客户端启动源码 五.NioEventLoop与netty线程模型 六.ChannelPi ...