[持续更新]hive异常解决方案
1. hive日志信息查看
文件路径
/tmp/<user.name>/hive.log
- 默认user.name为root
2. 加载数据失败
报错提示
Loading data to table default.test01
Failed with exception Unable to move source file:/root/hive_test.txt to destination hdfs://bigdata01:9000/user/hive/warehouse/test01/hive_test_copy_1.txt
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
异常原因
解决方案
3. 加载驱动失败
报错提示
Caused by: org.datanucleus.store.rdbms.connectionpool.DatastoreDriverNotFoundException: The specified datastore driver ("com.mysql.jdbc.Driver") was not found in the CLASSPATH. Please check your CLASSPATH specification, and the name of the driver.
at org.datanucleus.store.rdbms.connectionpool.AbstractConnectionPoolFactory.loadDriver(AbstractConnectionPoolFactory.java:58)
at org.datanucleus.store.rdbms.connectionpool.BoneCPConnectionPoolFactory.createConnectionPool(BoneCPConnectionPoolFactory.java:54)
at org.datanucleus.store.rdbms.ConnectionFactoryImpl.generateDataSources(ConnectionFactoryImpl.java:213)
异常原因
解决方案
4. Hive建表报错
报错提示
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:An exception was thrown while adding/validating class(es) : Column length too big for column 'TYPE_NAME' (max = 21845); use BLOB or TEXT instead
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Column length too big for column 'TYPE_NAME' (max = 21845); use BLOB or TEXT instead
异常原因
解决方案
- 登录MySQL执行:
use Hive数据库名
- 查看当前编码:
show variables like "char%";
- 修改编码:
alter database Hive数据库名 character set latin1;