hive创建表失败:FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
来源:互联网 发布:express.js w3cschool 编辑:程序博客网 时间:2024/05/13 17:22
前言:本文是在博主:http://blog.sina.com.cn/s/blog_7673d4a50102v7s1.html;博客基础上对遇到的问题的一个总结
把hive 的metadata配置成mysql,在mysql数据库里创建了hivedb后,修改hive的conf目录下的hive-site.xml
并且把 mysql-connector-java-5.1.22-bin.jar拷到hive的lib目录下面.
这里用的事hive0.14版本
这里用的事hive0.14版本
结果运行hive, create table:
hive> create table t1
> (tid int, tname string, age int);
Moved: 'hdfs://master:9000/home/hadoop/hive-0.14.0/warehouse/hive_table.db/t1' to trash at: hdfs://master:9000/user/root/.Trash/Current
Moved: 'hdfs://master:9000/home/hadoop/hive-0.14.0/warehouse/hive_table.db/t1' to trash at: hdfs://master:9000/user/root/.Trash/Current
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 is 767 bytes
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
........
hive> create table t1
> (tid int, tname string, age int);
Moved: 'hdfs://master:9000/home/hadoop/hive-0.14.0/warehouse/hive_table.db/t1' to trash at: hdfs://master:9000/user/root/.Trash/Current
Moved: 'hdfs://master:9000/home/hadoop/hive-0.14.0/warehouse/hive_table.db/t1' to trash at: hdfs://master:9000/user/root/.Trash/Current
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 is 767 bytes
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
........
查看hive 的log:(本人小白一个,查的这个日志跟主页上显示的一样)
cat hive.log
2017-01-06 16:29:28,911 ERROR [main]: ql.Driver (SessionState.java:printError(833)) - 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 is 767 bytescat hive.log
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
搜了下,在mysql上执行:
在mysql机器的上运行:
alter database hive character set latin1;
mysql> alter database hive character set latin1;
Query OK, 1 row affected (0.13 sec)
注意:
mysql latin1 utf8区别 那个比较强大
这是两种不同的编码,因为字节数的关系,有些国家的语言不能用latin1显示,
所以一般使用utf8编码,utf8是万国语言编码,既绝大多数国家的语言都可以用utf8
问题解决.
> create table t1
> (tid int, tname string, age int);
OK
Time taken: 0.98 seconds
hive> show tables;
OK
t1
Time taken: 0.04 seconds, Fetched: 1 row(s)
> (tid int, tname string, age int);
OK
Time taken: 0.98 seconds
hive> show tables;
OK
t1
Time taken: 0.04 seconds, Fetched: 1 row(s)
0 0
- hive创建表失败:FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
- FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(me
- hive Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException
- Hive连接Mysql---FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
- Hive连接Mysql---FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
- FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. org/bson/convers
- Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeExcept
- FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.Runtim
- Hive创建表格报【Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException】引发的血案
- FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
- FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask.
- hive中删除表的错误Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException
- FAILED: Execution Error, return code 3 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask
- FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
- FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask
- FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
- FAILED: Execution Error, return code 3 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask
- 程序中执行hive sql出错[FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask]
- 停车场自动停车,取车创意
- java 方法参数过多解决方法
- http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0327/2647.html
- LA 6026 Asteroid Rangers
- 一个清华学子写的关于directshow的学习心得
- hive创建表失败:FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.
- LinkedHashMap 和 HashMap 比较
- linux file命令查看elf文件信息
- 【Get深一度】相控阵-FDA设计思路-相控阵雷达原理
- Android第七课;ToggleButton
- 使用spring-session、redeis实现跨二级域名单点登录
- 面试算法学习-3-回文判断
- 深入浅出: Java回调机制(异步)
- 初学者如何写移动端响应式布局