Note that there are some explanatory texts on larger screens.

plurals
  1. POFailed to create table after install hive-0.7.1 using MySQL as the metastore
    primarykey
    data
    text
    <p>I installed hive-0.7.1 using MySQL 5.5 as the metastore. When I tried to create a simple table, it failed. I got exception </p> <pre><code>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`)) </code></pre> <p>Please help to advice how I should proceed.</p> <pre><code>hive&gt; 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 </code></pre> <p>hive-site.xml settings as below:</p> <pre><code>&lt;property&gt; &lt;name&gt;hive.metastore.local&lt;/name&gt; &lt;value&gt;true&lt;/value&gt; &lt;/property&gt; &lt;property&gt; &lt;name&gt;javax.jdo.option.ConnectionURL&lt;/name&gt; &lt;value&gt;jdbc:mysql://localhost:3306/hiveone?createDatabaseIfNotExist=true&lt;/value&gt; &lt;/property&gt; &lt;property&gt; &lt;name&gt;javax.jdo.option.ConnectionDriverName&lt;/name&gt; &lt;value&gt;com.mysql.jdbc.Driver&lt;/value&gt; &lt;/property&gt; &lt;property&gt; &lt;name&gt;javax.jdo.option.ConnectionUserName&lt;/name&gt; &lt;value&gt;hadoop&lt;/value&gt; &lt;/property&gt; &lt;property&gt; &lt;name&gt;javax.jdo.option.ConnectionPassword&lt;/name&gt; &lt;value&gt;pwd&lt;/value&gt; &lt;/property&gt; &lt;/configuration&gt; </code></pre> <p>Tables in MySQL are listed below:</p> <p>SDS table is empty.</p> <pre><code>mysql&gt; 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) </code></pre> <p>The question is what SDS data does Hive expect? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload