Review Board 1.7.22


HIVE-4024 Derby metastore update script will fail when upgrading from 0.9.0 to 0.10.0

Review Request #9462 - Created Feb. 15, 2013 and submitted

Jarek Cecho
HIVE-4024
Reviewers
hive
hive
I've provided similar solution as in HIVE-3995, HIVE-3998 and HIVE-3999.
I've tested the upgrade procedure.

Diff revision 1 (Latest)

  1. /trunk/metastore/scripts/upgrade/derby/011-HIVE-3649.derby.sql: Loading...
/trunk/metastore/scripts/upgrade/derby/011-HIVE-3649.derby.sql
Revision 1443292 New Change
1
ALTER TABLE "SDS" ADD  "IS_STOREDASSUBDIRECTORIES" CHAR(1) NOT NULL;
1
-- Add new not null column into SDS table in three steps

    
   
2

   

    
   
3
-- Step 1: Add the column allowing null

    
   
4
ALTER TABLE "SDS" ADD "IS_STOREDASSUBDIRECTORIES" CHAR(1);

    
   
5

   

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

    
   
7
UPDATE "SDS" SET "IS_STOREDASSUBDIRECTORIES" = 'N';

    
   
8

   

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

    
   
10
ALTER TABLE "SDS" ALTER COLUMN "IS_STOREDASSUBDIRECTORIES" NOT NULL;
  1. /trunk/metastore/scripts/upgrade/derby/011-HIVE-3649.derby.sql: Loading...