gpt4 book ai didi

mysql - 使用 MySQL 作为 Metastore 安装 hive-0.7.1 后无法创建表

转载 作者:可可西里 更新时间:2023-11-01 15:41:40 26 4
gpt4 key购买 nike

我使用 MySQL 5.5 作为 Metastore 安装了 hive-0.7.1。当我尝试创建一个简单的表时,它失败了。我遇到了异常

com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`hiveone`.`tbls`, CONSTRAINT `TBLS_FK2` FOREIGN KEY (`SD_ID`) REFERENCES `SDS` (`SD_ID`))

请帮助建议我应该如何进行。

hive> CREATE TABLE pokes (foo INT, bar STRING);
FAILED: Error in metadata: javax.jdo.JDODataStoreException: Insert of object "org.apache.hadoop.hive.metastore.model.MTable@4d092447" using statement "INSERT INTO `TBLS` (`TBL_ID`,`LAST_ACCESS_TIME`,`TBL_TYPE`,`CREATE_TIME`,`OWNER`,`SD_ID`,`RETENTION`,`VIEW_ORIGINAL_TEXT`,`TBL_NAME`,`DB_ID`,`VIEW_EXPANDED_TEXT`) VALUES (?,?,?,?,?,?,?,?,?,?,?)" failed : Cannot add or update a child row: a foreign key constraint fails (`hiveone`.`tbls`, CONSTRAINT `TBLS_FK2` FOREIGN KEY (`SD_ID`) REFERENCES `SDS` (`SD_ID`))
NestedThrowables:
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`hiveone`.`tbls`, CONSTRAINT `TBLS_FK2` FOREIGN KEY (`SD_ID`) REFERENCES `SDS` (`SD_ID`))
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

hive-site.xml 设置如下:

<property>
<name>hive.metastore.local</name>
<value>true</value>
</property>

<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hiveone?createDatabaseIfNotExist=true</value>
</property>

<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>

<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hadoop</value>
</property>

<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>pwd</value>
</property>

</configuration>

MySQL 中的表如下:

SDS 表为空。

mysql> show tables;
+-------------------+
| Tables_in_hiveone |
+-------------------+
| BUCKETING_COLS |
| COLUMNS |
| DATABASE_PARAMS |
| PARTITION_KEYS |
| SDS |
| SD_PARAMS |
| SEQUENCE_TABLE |
| SERDES |
| SERDE_PARAMS |
| SORT_COLS |
| TABLE_PARAMS |
| TBLS |
| dbs |
+-------------------+
13 rows in set (0.00 sec)

问题是 Hive 期望什么 SDS 数据?

最佳答案

hive-0.7.1 不支持 MySQL 5.5。故事的结局。

关于mysql - 使用 MySQL 作为 Metastore 安装 hive-0.7.1 后无法创建表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8482510/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com