hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1667815 - in /hive/trunk/metastore/scripts/upgrade: mssql/ oracle/ postgres/
Date Thu, 19 Mar 2015 16:52:11 GMT
Author: sershe
Date: Thu Mar 19 16:52:11 2015
New Revision: 1667815

URL: http://svn.apache.org/r1667815
Log:
HIVE-9919 : upgrade scripts don't work on some auto-created DBs due to absence of tables (Sergey
Shelukhin, reviewed by Thejas M Nair)

Added:
    hive/trunk/metastore/scripts/upgrade/mssql/pre-1-upgrade-0.12.0-to-0.13.0.mssql.sql
    hive/trunk/metastore/scripts/upgrade/mssql/pre-1-upgrade-0.13.0-to-0.14.0.mssql.sql
Modified:
    hive/trunk/metastore/scripts/upgrade/mssql/pre-0-upgrade-0.12.0-to-0.13.0.mssql.sql
    hive/trunk/metastore/scripts/upgrade/mssql/pre-0-upgrade-0.13.0-to-0.14.0.mssql.sql
    hive/trunk/metastore/scripts/upgrade/oracle/pre-0-upgrade-0.13.0-to-0.14.0.oracle.sql
    hive/trunk/metastore/scripts/upgrade/postgres/pre-0-upgrade-0.13.0-to-0.14.0.postgres.sql

Modified: hive/trunk/metastore/scripts/upgrade/mssql/pre-0-upgrade-0.12.0-to-0.13.0.mssql.sql
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/scripts/upgrade/mssql/pre-0-upgrade-0.12.0-to-0.13.0.mssql.sql?rev=1667815&r1=1667814&r2=1667815&view=diff
==============================================================================
--- hive/trunk/metastore/scripts/upgrade/mssql/pre-0-upgrade-0.12.0-to-0.13.0.mssql.sql (original)
+++ hive/trunk/metastore/scripts/upgrade/mssql/pre-0-upgrade-0.12.0-to-0.13.0.mssql.sql Thu
Mar 19 16:52:11 2015
@@ -19,3 +19,10 @@ CREATE TABLE PART_COL_STATS
     PARTITION_NAME varchar(767) NOT NULL,
     "TABLE_NAME" varchar(128) NOT NULL
 );
+
+ALTER TABLE PART_COL_STATS ADD CONSTRAINT PART_COL_STATS_PK PRIMARY KEY (CS_ID);
+
+ALTER TABLE PART_COL_STATS ADD CONSTRAINT PART_COL_STATS_FK1 FOREIGN KEY (PART_ID) REFERENCES
PARTITIONS (PART_ID) ;
+
+CREATE INDEX PART_COL_STATS_N49 ON PART_COL_STATS (PART_ID);
+

Modified: hive/trunk/metastore/scripts/upgrade/mssql/pre-0-upgrade-0.13.0-to-0.14.0.mssql.sql
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/scripts/upgrade/mssql/pre-0-upgrade-0.13.0-to-0.14.0.mssql.sql?rev=1667815&r1=1667814&r2=1667815&view=diff
==============================================================================
--- hive/trunk/metastore/scripts/upgrade/mssql/pre-0-upgrade-0.13.0-to-0.14.0.mssql.sql (original)
+++ hive/trunk/metastore/scripts/upgrade/mssql/pre-0-upgrade-0.13.0-to-0.14.0.mssql.sql Thu
Mar 19 16:52:11 2015
@@ -21,3 +21,9 @@ CREATE TABLE PART_COL_STATS
     PARTITION_NAME varchar(767) NOT NULL,
     "TABLE_NAME" varchar(128) NOT NULL
 );
+
+ALTER TABLE PART_COL_STATS ADD CONSTRAINT PART_COL_STATS_PK PRIMARY KEY (CS_ID);
+
+ALTER TABLE PART_COL_STATS ADD CONSTRAINT PART_COL_STATS_FK1 FOREIGN KEY (PART_ID) REFERENCES
PARTITIONS (PART_ID) ;
+
+CREATE INDEX PART_COL_STATS_N49 ON PART_COL_STATS (PART_ID);

Added: hive/trunk/metastore/scripts/upgrade/mssql/pre-1-upgrade-0.12.0-to-0.13.0.mssql.sql
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/scripts/upgrade/mssql/pre-1-upgrade-0.12.0-to-0.13.0.mssql.sql?rev=1667815&view=auto
==============================================================================
--- hive/trunk/metastore/scripts/upgrade/mssql/pre-1-upgrade-0.12.0-to-0.13.0.mssql.sql (added)
+++ hive/trunk/metastore/scripts/upgrade/mssql/pre-1-upgrade-0.12.0-to-0.13.0.mssql.sql Thu
Mar 19 16:52:11 2015
@@ -0,0 +1,26 @@
+CREATE TABLE TAB_COL_STATS
+(
+    CS_ID bigint NOT NULL,
+    AVG_COL_LEN float NULL,
+    "COLUMN_NAME" varchar(128) NOT NULL,
+    COLUMN_TYPE varchar(128) NOT NULL,
+    DB_NAME varchar(128) NOT NULL,
+    DOUBLE_HIGH_VALUE float NULL,
+    DOUBLE_LOW_VALUE float NULL,
+    LAST_ANALYZED bigint NOT NULL,
+    LONG_HIGH_VALUE bigint NULL,
+    LONG_LOW_VALUE bigint NULL,
+    MAX_COL_LEN bigint NULL,
+    NUM_DISTINCTS bigint NULL,
+    NUM_FALSES bigint NULL,
+    NUM_NULLS bigint NOT NULL,
+    NUM_TRUES bigint NULL,
+    TBL_ID bigint NULL,
+    "TABLE_NAME" varchar(128) NOT NULL
+);
+
+ALTER TABLE TAB_COL_STATS ADD CONSTRAINT TAB_COL_STATS_PK PRIMARY KEY (CS_ID);
+
+ALTER TABLE TAB_COL_STATS ADD CONSTRAINT TAB_COL_STATS_FK1 FOREIGN KEY (TBL_ID) REFERENCES
TBLS (TBL_ID) ;
+
+CREATE INDEX TAB_COL_STATS_N49 ON TAB_COL_STATS (TBL_ID);

Added: hive/trunk/metastore/scripts/upgrade/mssql/pre-1-upgrade-0.13.0-to-0.14.0.mssql.sql
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/scripts/upgrade/mssql/pre-1-upgrade-0.13.0-to-0.14.0.mssql.sql?rev=1667815&view=auto
==============================================================================
--- hive/trunk/metastore/scripts/upgrade/mssql/pre-1-upgrade-0.13.0-to-0.14.0.mssql.sql (added)
+++ hive/trunk/metastore/scripts/upgrade/mssql/pre-1-upgrade-0.13.0-to-0.14.0.mssql.sql Thu
Mar 19 16:52:11 2015
@@ -0,0 +1,28 @@
+CREATE TABLE TAB_COL_STATS
+(
+    CS_ID bigint NOT NULL,
+    AVG_COL_LEN float NULL,
+    "COLUMN_NAME" varchar(128) NOT NULL,
+    COLUMN_TYPE varchar(128) NOT NULL,
+    DB_NAME varchar(128) NOT NULL,
+    BIG_DECIMAL_HIGH_VALUE varchar(255) NULL,
+    BIG_DECIMAL_LOW_VALUE varchar(255) NULL,
+    DOUBLE_HIGH_VALUE float NULL,
+    DOUBLE_LOW_VALUE float NULL,
+    LAST_ANALYZED bigint NOT NULL,
+    LONG_HIGH_VALUE bigint NULL,
+    LONG_LOW_VALUE bigint NULL,
+    MAX_COL_LEN bigint NULL,
+    NUM_DISTINCTS bigint NULL,
+    NUM_FALSES bigint NULL,
+    NUM_NULLS bigint NOT NULL,
+    NUM_TRUES bigint NULL,
+    TBL_ID bigint NULL,
+    "TABLE_NAME" varchar(128) NOT NULL
+);
+
+ALTER TABLE TAB_COL_STATS ADD CONSTRAINT TAB_COL_STATS_PK PRIMARY KEY (CS_ID);
+
+ALTER TABLE TAB_COL_STATS ADD CONSTRAINT TAB_COL_STATS_FK1 FOREIGN KEY (TBL_ID) REFERENCES
TBLS (TBL_ID) ;
+
+CREATE INDEX TAB_COL_STATS_N49 ON TAB_COL_STATS (TBL_ID);

Modified: hive/trunk/metastore/scripts/upgrade/oracle/pre-0-upgrade-0.13.0-to-0.14.0.oracle.sql
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/scripts/upgrade/oracle/pre-0-upgrade-0.13.0-to-0.14.0.oracle.sql?rev=1667815&r1=1667814&r2=1667815&view=diff
==============================================================================
--- hive/trunk/metastore/scripts/upgrade/oracle/pre-0-upgrade-0.13.0-to-0.14.0.oracle.sql
(original)
+++ hive/trunk/metastore/scripts/upgrade/oracle/pre-0-upgrade-0.13.0-to-0.14.0.oracle.sql
Thu Mar 19 16:52:11 2015
@@ -21,3 +21,9 @@ MAX_COL_LEN NUMBER,
 NUM_TRUES NUMBER,
 NUM_FALSES NUMBER,
 LAST_ANALYZED NUMBER NOT NULL);
+
+ALTER TABLE PART_COL_STATS ADD CONSTRAINT PART_COL_STATS_PKEY PRIMARY KEY (CS_ID);
+
+ALTER TABLE PART_COL_STATS ADD CONSTRAINT PART_COL_STATS_FK FOREIGN KEY (PART_ID) REFERENCES
PARTITIONS (PART_ID) INITIALLY DEFERRED;
+
+CREATE INDEX PART_COL_STATS_N49 ON PART_COL_STATS (PART_ID);

Modified: hive/trunk/metastore/scripts/upgrade/postgres/pre-0-upgrade-0.13.0-to-0.14.0.postgres.sql
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/scripts/upgrade/postgres/pre-0-upgrade-0.13.0-to-0.14.0.postgres.sql?rev=1667815&r1=1667814&r2=1667815&view=diff
==============================================================================
--- hive/trunk/metastore/scripts/upgrade/postgres/pre-0-upgrade-0.13.0-to-0.14.0.postgres.sql
(original)
+++ hive/trunk/metastore/scripts/upgrade/postgres/pre-0-upgrade-0.13.0-to-0.14.0.postgres.sql
Thu Mar 19 16:52:11 2015
@@ -21,3 +21,9 @@ CREATE TABLE "PART_COL_STATS" (
  "NUM_FALSES" bigint,
  "LAST_ANALYZED" bigint NOT NULL
 );
+
+ALTER TABLE ONLY "PART_COL_STATS" ADD CONSTRAINT "PART_COL_STATS_pkey" PRIMARY KEY("CS_ID");
+
+CREATE INDEX "PART_COL_STATS_N49" ON "PART_COL_STATS" USING btree ("PART_ID");
+
+ALTER TABLE ONLY "PART_COL_STATS" ADD CONSTRAINT "PART_COL_STATS_fkey" FOREIGN KEY("PART_ID")
REFERENCES "PARTITIONS"("PART_ID") DEFERRABLE;



Mime
View raw message