hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r1005250 - in /hadoop/hive/branches/branch-0.6: ./ metastore/scripts/upgrade/ metastore/scripts/upgrade/derby/ metastore/scripts/upgrade/mysql/
Date Wed, 06 Oct 2010 21:03:22 GMT
Author: namit
Date: Wed Oct  6 21:03:22 2010
New Revision: 1005250

URL: http://svn.apache.org/viewvc?rev=1005250&view=rev
Log:
HIVE-1427. Add metastore schema migration scripts (0.5 -> 0.6)
(Carl Steinback via namit)


Added:
    hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/
    hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/derby/
    hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/derby/README
    hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/derby/upgrade-0.6.0.derby.sql
    hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/mysql/
    hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/mysql/README
    hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/mysql/upgrade-0.6.0.mysql.sql
Modified:
    hadoop/hive/branches/branch-0.6/CHANGES.txt

Modified: hadoop/hive/branches/branch-0.6/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.6/CHANGES.txt?rev=1005250&r1=1005249&r2=1005250&view=diff
==============================================================================
--- hadoop/hive/branches/branch-0.6/CHANGES.txt (original)
+++ hadoop/hive/branches/branch-0.6/CHANGES.txt Wed Oct  6 21:03:22 2010
@@ -108,6 +108,9 @@ Release 0.6.0 -  Unreleased
     HIVE-675. add database/schema support Hive QL
     (Carl Steinbach via namit)
 
+    HIVE-1427. Add metastore schema migration scripts (0.5 -> 0.6)
+    (Carl Steinback via namit)
+
   IMPROVEMENTS
     HIVE-983. Function from_unixtime takes long.
     (Ning Zhang via zshao)

Added: hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/derby/README
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/derby/README?rev=1005250&view=auto
==============================================================================
--- hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/derby/README (added)
+++ hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/derby/README Wed Oct  6 21:03:22
2010
@@ -0,0 +1,17 @@
+
+1) Shutdown your metastore instance.
+
+2) Perform a backup of your Derby metastore database. Probably
+   the easiest way of doing this is to just create a copy of the
+   Derby database "metastore_db" directory.
+
+3) Execute the upgrade script:
+   % ij
+   ij version 10.4
+   ij> CONNECT 'jdbc:derby:/Users/bob/hive/metastore_db;databaseName=metastore_db';
+   ij> RUN 'upgrade-0.6.0.derby.sql';
+   ij> quit;
+
+NOTE: You may need to install the Derby 'ij' utility.
+      Look here for installation instructions:
+      http://db.apache.org/derby/docs/10.4/getstart/

Added: hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/derby/upgrade-0.6.0.derby.sql
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/derby/upgrade-0.6.0.derby.sql?rev=1005250&view=auto
==============================================================================
--- hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/derby/upgrade-0.6.0.derby.sql
(added)
+++ hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/derby/upgrade-0.6.0.derby.sql
Wed Oct  6 21:03:22 2010
@@ -0,0 +1,26 @@
+-- HIVE-972: Support views
+ALTER TABLE "TBLS" ADD "VIEW_ORIGINAL_TEXT" LONG VARCHAR DEFAULT NULL;
+ALTER TABLE "TBLS" ADD "VIEW_EXPANDED_TEXT" LONG VARCHAR DEFAULT NULL;
+
+-- HIVE-1068: CREATE VIEW followup: add a 'table type' enum
+--            attribute in metastore
+ALTER TABLE "TBLS" ADD COLUMN "TBL_TYPE" VARCHAR(128);
+
+-- HIVE-675: Add database/schema support for Hive QL
+ALTER TABLE "DBS" ALTER "DESC" SET DATA TYPE VARCHAR(4000);
+ALTER TABLE "DBS" ADD "DB_LOCATION_URI" VARCHAR(4000) NOT NULL DEFAULT '';
+
+-- HIVE-1364: Increase the maximum length of various metastore fields,
+--            and remove TYPE_NAME from COLUMNS primary key
+ALTER TABLE "TBLS" ALTER "OWNER" SET DATA TYPE VARCHAR(767);
+ALTER TABLE "COLUMNS" ALTER "TYPE_NAME" SET DATA TYPE VARCHAR(4000);
+ALTER TABLE "PARTITION_KEYS" ALTER "PKEY_COMMENT" SET DATA TYPE VARCHAR(4000);
+ALTER TABLE "SD_PARAMS" ALTER "PARAM_VALUE" SET DATA TYPE VARCHAR(4000);
+ALTER TABLE "SDS" ALTER "INPUT_FORMAT" SET DATA TYPE VARCHAR(4000);
+ALTER TABLE "SDS" ALTER "LOCATION" SET DATA TYPE VARCHAR(4000);
+ALTER TABLE "SDS" ALTER "OUTPUT_FORMAT" SET DATA TYPE VARCHAR(4000);
+ALTER TABLE "SERDE_PARAMS" ALTER "PARAM_VALUE" SET DATA TYPE VARCHAR(4000);
+ALTER TABLE "SERDES" ALTER "SLIB" SET DATA TYPE VARCHAR(4000);
+ALTER TABLE "TABLE_PARAMS" ALTER "PARAM_VALUE" SET DATA TYPE VARCHAR(4000);
+ALTER TABLE "COLUMNS" DROP PRIMARY KEY;
+ALTER TABLE "COLUMNS" ADD PRIMARY KEY ("SD_ID", "COLUMN_NAME");

Added: hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/mysql/README
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/mysql/README?rev=1005250&view=auto
==============================================================================
--- hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/mysql/README (added)
+++ hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/mysql/README Wed Oct  6 21:03:22
2010
@@ -0,0 +1,9 @@
+
+1) Shutdown your metastore instance.
+
+2) Perform a backup of your MySQL metastore database:
+   % mysqldump --opt <metastore_db_name> > metastore_backup.sql
+
+3) Execute the upgrade script:
+   % mysql --user=<username> --password=<password> \
+     <metastore_db_name> < upgrade-0.6.0.mysql.sql

Added: hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/mysql/upgrade-0.6.0.mysql.sql
URL: http://svn.apache.org/viewvc/hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/mysql/upgrade-0.6.0.mysql.sql?rev=1005250&view=auto
==============================================================================
--- hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/mysql/upgrade-0.6.0.mysql.sql
(added)
+++ hadoop/hive/branches/branch-0.6/metastore/scripts/upgrade/mysql/upgrade-0.6.0.mysql.sql
Wed Oct  6 21:03:22 2010
@@ -0,0 +1,26 @@
+-- HIVE-972: Support views
+ALTER TABLE `TBLS` ADD `VIEW_EXPANDED_TEXT` mediumtext;
+ALTER TABLE `TBLS` ADD `VIEW_ORIGINAL_TEXT` mediumtext;
+
+-- HIVE-1068: CREATE VIEW followup: add a 'table type' enum
+--            attribute in metastore
+ALTER TABLE `TBLS` ADD `TBL_TYPE` VARCHAR(128);
+
+-- HIVE-675: Add database/schema support for Hive QL
+ALTER TABLE `DBS` MODIFY `DESC` VARCHAR(4000);
+ALTER TABLE `DBS` ADD `DB_LOCATION_URI` VARCHAR(4000) NOT NULL DEFAULT '';
+
+-- HIVE-1364: Increase the maximum length of various metastore fields,
+--            and remove TYPE_NAME from COLUMNS primary key
+ALTER TABLE `TBLS` MODIFY `OWNER` VARCHAR(767);
+ALTER TABLE `COLUMNS` MODIFY `TYPE_NAME` VARCHAR(4000);
+ALTER TABLE `PARTITION_KEYS` MODIFY `PKEY_COMMENT` VARCHAR(4000);
+ALTER TABLE `SD_PARAMS` MODIFY `PARAM_VALUE` VARCHAR(4000);
+ALTER TABLE `SDS` MODIFY `INPUT_FORMAT` VARCHAR(4000);
+ALTER TABLE `SDS` MODIFY `LOCATION` VARCHAR(4000);
+ALTER TABLE `SDS` MODIFY `OUTPUT_FORMAT` VARCHAR(4000);
+ALTER TABLE `SERDE_PARAMS` MODIFY `PARAM_VALUE` VARCHAR(4000);
+ALTER TABLE `SERDES` MODIFY `SLIB` VARCHAR(4000);
+ALTER TABLE `TABLE_PARAMS` MODIFY `PARAM_VALUE` VARCHAR(4000);
+ALTER TABLE `COLUMNS` DROP PRIMARY KEY;
+ALTER TABLE `COLUMNS` ADD PRIMARY KEY (`SD_ID`, `COLUMN_NAME`);



Mime
View raw message