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

John Sichi commented on HIVE-2011:
----------------------------------

I gave this one a try using MySQL.  First, I started with an 0.6 build and got 
it to autocreate a schema there.  (I don't know of a way to force creation of 
all tables, so the schema was incomplete.)

Then I applied this patch to 0.7, built there, and ran the upgrade script.  It 
failed because the PARTS table hadn't been created in 0.6 (I had only created 
an unpartitioned table there).  This is fine; the only part which could be 
improved is that the script did not stop after the errors, so the tail looks 
like this:

{noformat}
...
Query OK, 0 rows affected (0.00 sec)

ERROR 1005 (HY000): Can't create table 
'./jsichi_hive_upgrade_test/PART_PRIVS.frm' (errno: 150)
ERROR 1005 (HY000): Can't create table 
'./jsichi_hive_upgrade_test/PART_COL_PRIVS.frm' (errno: 150)
+---------------------------------------------------------+
|                                                         |
+---------------------------------------------------------+
| Finished upgrading MetaStore schema from 0.6.0 to 0.7.0 | 
+---------------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
{noformat}

Should we change the README instructions to use something which will abort on 
exception?  Otherwise, for an error in the middle of a long upgrade sequence, 
the administrator might miss it and think all was well.


> upgrade-0.6.0.mysql.sql script attempts to increase size of PK 
> COLUMNS.TYPE_NAME to 4000
> ----------------------------------------------------------------------------------------
>
>                 Key: HIVE-2011
>                 URL: https://issues.apache.org/jira/browse/HIVE-2011
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>    Affects Versions: 0.6.0
>            Reporter: Carl Steinbach
>            Assignee: Carl Steinbach
>            Priority: Blocker
>             Fix For: 0.7.0
>
>         Attachments: HIVE-2011.1.patch.txt
>
>
> {code}
> # mysql flumenewresearch < upgrade-0.6.0.mysql.sql 
> ERROR 1071 (42000) at line 16: Specified key was too long; max key length is 
> 767 bytes
> {code}
> Here's the cause of the problem from upgrade-0.6.0.mysql.sql:
> {code}
> ...
> ALTER TABLE `COLUMNS` MODIFY `TYPE_NAME` VARCHAR(4000);
> ...
> ALTER TABLE `COLUMNS` DROP PRIMARY KEY;
> ALTER TABLE `COLUMNS` ADD PRIMARY KEY (`SD_ID`, `COLUMN_NAME`);
> ...
> {code}
> We need to make sure that the PK on COLUMNS.TYPE_NAME is dropped before the 
> size of the column is bumped to 4000.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to