You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by na...@apache.org on 2013/02/19 04:57:48 UTC

svn commit: r1447584 - /hive/trunk/metastore/scripts/upgrade/derby/011-HIVE-3649.derby.sql

Author: namit
Date: Tue Feb 19 03:57:48 2013
New Revision: 1447584

URL: http://svn.apache.org/r1447584
Log:
HIVE-4024 Derby metastore update script will fail when upgrading from 0.9.0
to 0.10.0 (Jarek Jarcec Cecho via namit)



Modified:
    hive/trunk/metastore/scripts/upgrade/derby/011-HIVE-3649.derby.sql

Modified: hive/trunk/metastore/scripts/upgrade/derby/011-HIVE-3649.derby.sql
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/scripts/upgrade/derby/011-HIVE-3649.derby.sql?rev=1447584&r1=1447583&r2=1447584&view=diff
==============================================================================
--- hive/trunk/metastore/scripts/upgrade/derby/011-HIVE-3649.derby.sql (original)
+++ hive/trunk/metastore/scripts/upgrade/derby/011-HIVE-3649.derby.sql Tue Feb 19 03:57:48 2013
@@ -1 +1,10 @@
-ALTER TABLE "SDS" ADD  "IS_STOREDASSUBDIRECTORIES" CHAR(1) NOT NULL;
+-- Add new not null column into SDS table in three steps
+
+-- Step 1: Add the column allowing null
+ALTER TABLE "SDS" ADD "IS_STOREDASSUBDIRECTORIES" CHAR(1);
+
+ -- Step 2: Replace the null with default value (false)
+UPDATE "SDS" SET "IS_STOREDASSUBDIRECTORIES" = 'N';
+
+-- Step 3: Alter the column to disallow null values
+ALTER TABLE "SDS" ALTER COLUMN "IS_STOREDASSUBDIRECTORIES" NOT NULL;