Review Board 1.7.22


HIVE-3998 Oracle metastore update script will fail when upgrading from 0.9.0 to 0.10.0

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

Jarek Cecho
HIVE-3998
Reviewers
hive
hive
I've done similar fix as in HIVE-3995.
I've tested the upgrade scripts on oracle express machine.

Diff revision 1 (Latest)

  1. /trunk/metastore/scripts/upgrade/oracle/011-HIVE-3649.oracle.sql: Loading...
/trunk/metastore/scripts/upgrade/oracle/011-HIVE-3649.oracle.sql
Revision 1443292 New Change
1
alter table  SDS add IS_STOREDASSUBDIRECTORIES NUMBER(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 NUMBER(1) NULL;

    
   
5

   

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

    
   
7
UPDATE SDS SET IS_STOREDASSUBDIRECTORIES = 0;

    
   
8

   

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

    
   
10
ALTER TABLE SDS MODIFY(IS_STOREDASSUBDIRECTORIES NOT NULL);
  1. /trunk/metastore/scripts/upgrade/oracle/011-HIVE-3649.oracle.sql: Loading...