Review Board 1.7.22


HIVE-3999 Mysql metastore upgrade script will end up with different schema than the full schema load

Review Request #9365 - Created Feb. 7, 2013 and submitted

Jarek Cecho
HIVE-3999
Reviewers
hive
hive
I've done similar fix as in HIVE-3998.
Tested on mysql metastore.

Diff revision 1 (Latest)

  1. /trunk/metastore/scripts/upgrade/mysql/011-HIVE-3649.mysql.sql: Loading...
/trunk/metastore/scripts/upgrade/mysql/011-HIVE-3649.mysql.sql
Revision 1443292 New Change
1
SELECT '< HIVE-3649: Support stored as directories >' AS ' ';
1
SELECT '< HIVE-3649: Support stored as directories >' AS ' ';
2
ALTER TABLE `SDS` ADD `IS_STOREDASSUBDIRECTORIES` bit(1) ;
2
-- Add new not null column into SDS table in three steps

    
   
3

   

    
   
4
-- Step 1: Add the column allowing null

    
   
5
ALTER TABLE `SDS` ADD `IS_STOREDASSUBDIRECTORIES` bit(1);

    
   
6

   

    
   
7
 -- Step 2: Replace the null with default value (false)

    
   
8
UPDATE `SDS` SET `IS_STOREDASSUBDIRECTORIES` = false;

    
   
9

   

    
   
10
-- Step 3: Alter the column to disallow null values

    
   
11
ALTER TABLE `SDS` MODIFY COLUMN `IS_STOREDASSUBDIRECTORIES` bit(1) NOT NULL;
  1. /trunk/metastore/scripts/upgrade/mysql/011-HIVE-3649.mysql.sql: Loading...