[ 
https://issues.apache.org/jira/browse/HIVE-3999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13580452#comment-13580452
 ] 

caofangkun commented on HIVE-3999:
----------------------------------

We'd better set a default value for column IS_STOREDASSUBDIRECTORIES:

ALTER TABLE `SDS` ADD  `IS_STOREDASSUBDIRECTORIES` BIT(1) NOT NULL;
ALTER TABLE `SDS` ALTER  `IS_STOREDASSUBDIRECTORIES` SET DEFAULT 0;

or Query May Throw :
Failed with exception javax.jdo.JDODataStoreException: Insert of object 
"org.apache.hadoop.hive.metastore.model.MStorageDescriptor@c3c44" using 
statement "INSERT INTO `SDS` 
(`SD_ID`,`OUTPUT_FORMAT`,`CD_ID`,`NUM_BUCKETS`,`INPUT_FORMAT`,`SERDE_ID`,`IS_COMPRESSED`,`LOCATION`)
 VALUES (?,?,?,?,?,?,?,?)" failed : Field 'IS_STOREDASSUBDIRECTORIES' doesn't 
have a default value
NestedThrowables:
java.sql.SQLException: Field 'IS_STOREDASSUBDIRECTORIES' doesn't have a default 
value
                
> Mysql metastore upgrade script will end up with different schema than the 
> full schema load
> ------------------------------------------------------------------------------------------
>
>                 Key: HIVE-3999
>                 URL: https://issues.apache.org/jira/browse/HIVE-3999
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>            Reporter: Jarek Jarcec Cecho
>            Assignee: Jarek Jarcec Cecho
>             Fix For: 0.11.0
>
>         Attachments: mysql_upgrade_issue.patch
>
>
> I've noticed that the file {{hive-schema-0.10.0.mysql.sql}} is creating table 
> SDS with following column:
> {code}
>   `IS_STOREDASSUBDIRECTORIES` bit(1) NOT NULL,
> {code}
> However the upgrade script {{011-HIVE-3649.mysql.sql}} will create the column 
> differently:
> {code}
> ALTER TABLE `SDS` ADD `IS_STOREDASSUBDIRECTORIES` bit(1) ;
> {code}
> Thus user will get slightly different schema each time - once with "NOT NULL" 
> and secondly with "NULL" definition.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to