创建表报错
Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException
(message:For direct MetaStore DB connections, we don't support retries at the client level.) (state=08S01,code=1)
- 注意,这里使用的hive链接为:jdbc:mysql://10.1.1.5:3306/hive?createDatabaseIfNotExist=true
- 如果数据库不存在会自动创建hive数据库,这时的hive数据编码会是默认数据库编码(我这里是UTF-8).修正数据库编码后正常创建表
- alter database hive character set latin1;
load数据错误
Caused by: MetaException(message:For direct MetaStore DB connections, we don't support retries at the client level.)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.reconnect(HiveMetaStoreClient.java:308)
at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:148)
at com.sun.proxy.$Proxy9.appendPartition(Unknown Source)
at org.apache.hadoop.hive.ql.metadata.Hive.getPartition(Hive.java:1849)
... 22 more
- 还是因为数据库字符集的原因,我这里数据库默认已经是latin,发现库中部分表仍然是UTF8,修改表为latin后导入数据仍然报错
- 解决办法,备份原有hive数据库并删除,然后新创建hive数据库,指定字符集latin(navicate有可能默认帮你设置UTF-8,创建后需再次查看是否为latin)
- 重启hive导入数据,成功