我将Hive与MySQL一起用作元存储,但不知何故无法创建数据库。在Hive安装之后,我能够创建一个数据库,但不能再创建数据库了。我收到以下错误,但有没有人知道这个问题的原因是什么?
hive> create database testingyou;
FAILED: Error in metadata: MetaException(message:javax.jdo.JDOUserException:
Could not create "increment"/"table" value-generation container `SEQUENCE_TABLE`
since autoCreate flags do not allow it.
NestedThrowables:
org.datanucleus.exceptions.NucleusUserException: Could not create
"increment"/"table" value-generation container `SEQUENCE_TABLE`
since autoCreate flags do not allow it. )
FAILED: Execution Error, return code 1 from
org.apache.hadoop.hive.ql.exec.DDLTask
答案 0 :(得分:1)
我有同样的问题,发现我忘记取消注释。完整步骤:
#
答案 1 :(得分:0)
检查你的mysql设置。
binlog_format
mysql> show variables like 'binlog_format';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | MIXED |
+---------------+-------+
1 row in set (0.00 sec)
binlog_format = STATEMENT是同样的错误
答案 2 :(得分:0)
一个可能的原因是Hive中的已知错误,其中Data Nucleus忘记转义数据库名称,例如'db-name'或[db-name]。当数据库目录名称有破折号时,HiveServer2将无法连接到它,因为在发出用于启动配置单元的关键命令时出现SQL语法错误:
Hive Metastore日志记录显示
2016-01-16 02:14:10,228 DEBUG [main]: Datastore.Native (Log4JLogger.java:debug(58)) - SELECT NEXT_VAL FROM db-name.dbo.SEQUENCE_TABLE WHERE SEQUENCE_NAME=<'org.apache.hadoop.hive.metastore.model.MDatabase'>
2016-01-16 02:14:10,233 INFO [main]: DataNucleus.ValueGeneration (Log4JLogger.java:info(77)) - Error encountered allocating block of IDs : Couldnt obtain a new sequence (unique id) : Incorrect syntax near '-'.
2016-01-16 02:14:10,233 INFO [main]: DataNucleus.ValueGeneration (Log4JLogger.java:info(77)) - Error encountered allocating block of IDs : Couldnt obtain a new sequence (unique id) : Incorrect syntax near '-'.
https://issues.apache.org/jira/browse/HIVE-6113正在跟踪该问题。作为Hive 2.0的一部分,将提供一个修复程序,目前尚无法解决所有问题。
在此之前,请确保在数据库目录名称中避免使用Dashhes或Hyphens。