diff --git metastore/scripts/upgrade/derby/019-HIVE-7784.derby.sql metastore/scripts/upgrade/derby/019-HIVE-7784.derby.sql new file mode 100644 index 0000000..66e6c12 --- /dev/null +++ metastore/scripts/upgrade/derby/019-HIVE-7784.derby.sql @@ -0,0 +1 @@ +CREATE INDEX "APP"."PCS_STATS_IDX" ON "APP"."PART_COL_STATS" ("DB_NAME","TABLE_NAME","COLUMN_NAME","PARTITION_NAME"); diff --git metastore/scripts/upgrade/mssql/002-HIVE-7784.mssql.sql metastore/scripts/upgrade/mssql/002-HIVE-7784.mssql.sql new file mode 100644 index 0000000..cc6ba09 --- /dev/null +++ metastore/scripts/upgrade/mssql/002-HIVE-7784.mssql.sql @@ -0,0 +1 @@ +CREATE INDEX PCS_STATS_IDX ON PART_COL_STATS (DB_NAME,TABLE_NAME,COLUMN_NAME,PARTITION_NAME); diff --git metastore/scripts/upgrade/mssql/upgrade-0.13.0-to-0.14.0.mssql.sql metastore/scripts/upgrade/mssql/upgrade-0.13.0-to-0.14.0.mssql.sql new file mode 100644 index 0000000..2b5f3b8 --- /dev/null +++ metastore/scripts/upgrade/mssql/upgrade-0.13.0-to-0.14.0.mssql.sql @@ -0,0 +1,6 @@ +SELECT 'Upgrading MetaStore schema from 0.13.0 to 0.14.0' AS MESSAGE; + +:r 002-HIVE-7784.mssql.sql; + +UPDATE VERSION SET SCHEMA_VERSION='0.14.0', VERSION_COMMENT='Hive release version 0.14.0' where VER_ID=1; +SELECT 'Finished upgrading MetaStore schema from 0.13.0 to 0.14.0' AS MESSAGE; diff --git metastore/scripts/upgrade/mssql/upgrade.order.mssql metastore/scripts/upgrade/mssql/upgrade.order.mssql index 6b84ce2..638345a 100644 --- metastore/scripts/upgrade/mssql/upgrade.order.mssql +++ metastore/scripts/upgrade/mssql/upgrade.order.mssql @@ -1,2 +1,3 @@ 0.11.0-to-0.12.0 0.12.0-to-0.13.0 +0.13.0-to-0.14.0 diff --git metastore/scripts/upgrade/mysql/019-HIVE-7784.mysql.sql metastore/scripts/upgrade/mysql/019-HIVE-7784.mysql.sql new file mode 100644 index 0000000..5d847bc --- /dev/null +++ metastore/scripts/upgrade/mysql/019-HIVE-7784.mysql.sql @@ -0,0 +1 @@ +CREATE INDEX PCS_STATS_IDX ON PART_COL_STATS (DB_NAME,TABLE_NAME,COLUMN_NAME,PARTITION_NAME) USING BTREE; diff --git metastore/scripts/upgrade/oracle/020-HIVE-7784.oracle.sql metastore/scripts/upgrade/oracle/020-HIVE-7784.oracle.sql new file mode 100644 index 0000000..cc6ba09 --- /dev/null +++ metastore/scripts/upgrade/oracle/020-HIVE-7784.oracle.sql @@ -0,0 +1 @@ +CREATE INDEX PCS_STATS_IDX ON PART_COL_STATS (DB_NAME,TABLE_NAME,COLUMN_NAME,PARTITION_NAME); diff --git metastore/scripts/upgrade/postgres/019-HIVE-7784.postgres.sql metastore/scripts/upgrade/postgres/019-HIVE-7784.postgres.sql new file mode 100644 index 0000000..ac6b749 --- /dev/null +++ metastore/scripts/upgrade/postgres/019-HIVE-7784.postgres.sql @@ -0,0 +1 @@ +CREATE INDEX "PCS_STATS_IDX" ON "PART_COL_STATS" USING btree ("DB_NAME","TABLE_NAME","COLUMN_NAME","PARTITION_NAME"); diff --git metastore/scripts/upgrade/derby/hive-schema-0.14.0.derby.sql metastore/scripts/upgrade/derby/hive-schema-0.14.0.derby.sql index 11ce4d6..90d5e9b 100644 --- metastore/scripts/upgrade/derby/hive-schema-0.14.0.derby.sql +++ metastore/scripts/upgrade/derby/hive-schema-0.14.0.derby.sql @@ -114,6 +114,8 @@ CREATE INDEX "APP"."TABLECOLUMNPRIVILEGEINDEX" ON "APP"."TBL_COL_PRIVS" ("TBL_ID CREATE UNIQUE INDEX "APP"."DBPRIVILEGEINDEX" ON "APP"."DB_PRIVS" ("DB_ID", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "DB_PRIV", "GRANTOR", "GRANTOR_TYPE"); +CREATE INDEX "APP"."PCS_STATS_IDX" ON "APP"."PART_COL_STATS" ("DB_NAME","TABLE_NAME","COLUMN_NAME","PARTITION_NAME"); + CREATE INDEX "APP"."PARTPRIVILEGEINDEX" ON "APP"."PART_PRIVS" ("PART_ID", "PRINCIPAL_NAME", "PRINCIPAL_TYPE", "PART_PRIV", "GRANTOR", "GRANTOR_TYPE"); CREATE UNIQUE INDEX "APP"."ROLEENTITYINDEX" ON "APP"."ROLES" ("ROLE_NAME"); diff --git metastore/scripts/upgrade/derby/upgrade-0.13.0-to-0.14.0.derby.sql metastore/scripts/upgrade/derby/upgrade-0.13.0-to-0.14.0.derby.sql index 82e7733..75193ce 100644 --- metastore/scripts/upgrade/derby/upgrade-0.13.0-to-0.14.0.derby.sql +++ metastore/scripts/upgrade/derby/upgrade-0.13.0-to-0.14.0.derby.sql @@ -1,3 +1,5 @@ -- Upgrade MetaStore schema from 0.13.0 to 0.14.0 +RUN '019-HIVE-7784.derby.sql'; + UPDATE "APP".VERSION SET SCHEMA_VERSION='0.14.0', VERSION_COMMENT='Hive release version 0.14.0' where VER_ID=1; diff --git metastore/scripts/upgrade/mysql/hive-schema-0.14.0.mysql.sql metastore/scripts/upgrade/mysql/hive-schema-0.14.0.mysql.sql index a509175..b479aa2 100644 --- metastore/scripts/upgrade/mysql/hive-schema-0.14.0.mysql.sql +++ metastore/scripts/upgrade/mysql/hive-schema-0.14.0.mysql.sql @@ -704,6 +704,8 @@ CREATE TABLE IF NOT EXISTS `PART_COL_STATS` ( CONSTRAINT `PART_COL_STATS_FK` FOREIGN KEY (`PART_ID`) REFERENCES `PARTITIONS` (`PART_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE INDEX PCS_STATS_IDX ON PART_COL_STATS (DB_NAME,TABLE_NAME,COLUMN_NAME,PARTITION_NAME) USING BTREE; + -- -- Table structure for table `TYPES` -- diff --git metastore/scripts/upgrade/mysql/upgrade-0.13.0-to-0.14.0.mysql.sql metastore/scripts/upgrade/mysql/upgrade-0.13.0-to-0.14.0.mysql.sql index 773ec34..ddcc3f5 100644 --- metastore/scripts/upgrade/mysql/upgrade-0.13.0-to-0.14.0.mysql.sql +++ metastore/scripts/upgrade/mysql/upgrade-0.13.0-to-0.14.0.mysql.sql @@ -1,4 +1,7 @@ SELECT 'Upgrading MetaStore schema from 0.13.0 to 0.14.0' AS ' '; +SOURCE 019-HIVE-7784.mysql.sql; + UPDATE VERSION SET SCHEMA_VERSION='0.14.0', VERSION_COMMENT='Hive release version 0.14.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 0.13.0 to 0.14.0' AS ' '; + diff --git metastore/scripts/upgrade/oracle/hive-schema-0.14.0.oracle.sql metastore/scripts/upgrade/oracle/hive-schema-0.14.0.oracle.sql index d43b59b..b810b3d 100644 --- metastore/scripts/upgrade/oracle/hive-schema-0.14.0.oracle.sql +++ metastore/scripts/upgrade/oracle/hive-schema-0.14.0.oracle.sql @@ -527,6 +527,8 @@ ALTER TABLE PART_COL_STATS ADD CONSTRAINT PART_COL_STATS_FK FOREIGN KEY (PART_ID CREATE INDEX PART_COL_STATS_N49 ON PART_COL_STATS (PART_ID); +CREATE INDEX PCS_STATS_IDX ON PART_COL_STATS (DB_NAME,TABLE_NAME,COLUMN_NAME,PARTITION_NAME); + CREATE TABLE FUNCS ( FUNC_ID NUMBER NOT NULL, CLASS_NAME VARCHAR2(4000), diff --git metastore/scripts/upgrade/oracle/upgrade-0.13.0-to-0.14.0.oracle.sql metastore/scripts/upgrade/oracle/upgrade-0.13.0-to-0.14.0.oracle.sql index b212fdb..9b09555 100644 --- metastore/scripts/upgrade/oracle/upgrade-0.13.0-to-0.14.0.oracle.sql +++ metastore/scripts/upgrade/oracle/upgrade-0.13.0-to-0.14.0.oracle.sql @@ -1,4 +1,6 @@ SELECT 'Upgrading MetaStore schema from 0.13.0 to 0.14.0' AS Status from dual; +@020-HIVE-7784.oracle.sql; + UPDATE VERSION SET SCHEMA_VERSION='0.14.0', VERSION_COMMENT='Hive release version 0.14.0' where VER_ID=1; SELECT 'Finished upgrading MetaStore schema from 0.13.0 to 0.14.0' AS Status from dual; diff --git metastore/scripts/upgrade/postgres/hive-schema-0.14.0.postgres.sql metastore/scripts/upgrade/postgres/hive-schema-0.14.0.postgres.sql index e292850..5358f50 100644 --- metastore/scripts/upgrade/postgres/hive-schema-0.14.0.postgres.sql +++ metastore/scripts/upgrade/postgres/hive-schema-0.14.0.postgres.sql @@ -1059,6 +1059,13 @@ CREATE INDEX "PART_PRIVS_N49" ON "PART_PRIVS" USING btree ("PART_ID"); -- +-- Name: PCS_STATS_IDX; Type: INDEX; Schema: public; Owner: hiveuser; Tablespace: +-- + +CREATE INDEX "PCS_STATS_IDX" ON "PART_COL_STATS" USING btree ("DB_NAME","TABLE_NAME","COLUMN_NAME","PARTITION_NAME"); + + +-- -- Name: ROLE_MAP_N49; Type: INDEX; Schema: public; Owner: hiveuser; Tablespace: -- diff --git metastore/scripts/upgrade/postgres/upgrade-0.13.0-to-0.14.0.postgres.sql metastore/scripts/upgrade/postgres/upgrade-0.13.0-to-0.14.0.postgres.sql index 23a6025..91aea44 100644 --- metastore/scripts/upgrade/postgres/upgrade-0.13.0-to-0.14.0.postgres.sql +++ metastore/scripts/upgrade/postgres/upgrade-0.13.0-to-0.14.0.postgres.sql @@ -1,6 +1,13 @@ SELECT 'Upgrading MetaStore schema from 0.13.0 to 0.14.0'; +\i 019-HIVE-7784.postgres.sql; + UPDATE "VERSION" SET "SCHEMA_VERSION"='0.14.0', "VERSION_COMMENT"='Hive release version 0.14.0' where "VER_ID"=1; SELECT 'Finished upgrading MetaStore schema from 0.13.0 to 0.14.0'; +-- +-- Name: PCS_STATS_IDX; Type: INDEX; Schema: public; Owner: hiveuser; Tablespace: +-- + +