hive 问题点总结(持续更新~~)

本文详细描述了在使用Hive加载数据时遇到的编码问题及错误日志信息,错误提示为数据键过长,最大长度为3072字节。通过将Hive数据库的编码修改为utf-8,成功解决了这一问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

问题1 hive库编码问题

hive加载数据报错日志为

hive> load data local inpath '/export/servers/hivedatas/score.csv' into table score2 partition(year='2018',month='06',day='01');
Loading data to table myhive.score2 partition (year=2018, month=06, day=01)
Failed with exception MetaException(message:Error(s) were found while auto-creating/validating the datastore for classes. The errors are printed in the log, and are attached to this exception.)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask. MetaException(message:Error(s) were found while auto-creating/validating the datastore for classes. The errors are pri nted in the log, and are attached to this exception.)

查看hive日志hive.log

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 3072 bytes
 

 

解决方式

把hive数据库编码改成utf-8 后再执行hive命令

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值