Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Failed to create table after install hive-0.7.1 using MySQL as the metastore

0

116 views
I installed hive-0.7.1 using MySQL 5.5 as the metastore. When I tried to create a simple table, it failed.

Please help to advice how I should proceed.

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 settings as below:


<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>


Tables in MySQL are listed below:

SDS table is empty.

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)
asked December 12, 2011 6:59 am AZOT
/users/64089/3rocky

0 Answers

Be the first to answer this question

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions
Hadoop/hive metastore
August 7, 2009
MySQL create table
April 13, 2011
Create table mysql
April 15, 2011