Gopal V created HIVE-17828: ------------------------------ Summary: Metastore: mysql upgrade scripts to 3.0.0 is broken Key: HIVE-17828 URL: https://issues.apache.org/jira/browse/HIVE-17828 Project: Hive Issue Type: Bug Affects Versions: 3.0.0 Reporter: Gopal V
{code} +---------------------------------------------------------+ | | +---------------------------------------------------------+ | Finished upgrading MetaStore schema from 2.2.0 to 2.3.0 | +---------------------------------------------------------+ 1 row in set, 1 warning (0.00 sec) mysql> source upgrade-2.3.0-to-3.0.0.mysql.sql +------------------------------------------------+ | | +------------------------------------------------+ | Upgrading MetaStore schema from 2.3.0 to 3.0.0 | +------------------------------------------------+ {code} {code} -------------- CREATE TABLE WM_RESOURCEPLAN ( `RP_ID` bigint(20) NOT NULL, `NAME` varchar(128) NOT NULL, `QUERY_PARALLELISM` int(11), `STATUS` varchar(20) NOT NULL, PRIMARY KEY (`RP_ID`), KEY `UNIQUE_WM_RESOURCEPLAN` (`NAME`), ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -------------- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ENGINE=InnoDB DEFAULT CHARSET=latin1' at line 8 -------------- CREATE TABLE WM_POOL ( `POOL_ID` bigint(20) NOT NULL, `RP_ID` bigint(20) NOT NULL, `PATH` varchar(1024) NOT NULL, `PARENT_POOL_ID` bigint(20), `ALLOC_FRACTION` DOUBLE, `QUERY_PARALLELISM` int(11), PRIMARY KEY (`POOL_ID`), KEY `UNIQUE_WM_POOL` (`RP_ID`, `PATH`), CONSTRAINT `WM_POOL_FK1` FOREIGN KEY (`RP_ID`) REFERENCES `WM_RESOURCEPLAN` (`RP_ID`), CONSTRAINT `WM_POOL_FK2` FOREIGN KEY (`PARENT_POOL_ID`) REFERENCES `WM_POOL` (`POOL_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -------------- ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes -------------- CREATE TABLE WM_TRIGGER ( `TRIGGER_ID` bigint(20) NOT NULL, `RP_ID` bigint(20) NOT NULL, `NAME` varchar(128) NOT NULL, `TRIGGER_EXPRESSION` varchar(1024), `ACTION_EXPRESSION` varchar(1024), PRIMARY KEY (`TRIGGER_ID`), KEY `UNIQUE_WM_TRIGGER` (`RP_ID`, `NAME`), CONSTRAINT `WM_TRIGGER_FK1` FOREIGN KEY (`RP_ID`) REFERENCES `WM_RESOURCEPLAN` (`RP_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -------------- ERROR 1215 (HY000): Cannot add foreign key constraint -------------- CREATE TABLE WM_POOL_TO_TRIGGER ( `POOL_ID` bigint(20) NOT NULL, `TRIGGER_ID` bigint(20) NOT NULL, PRIMARY KEY (`POOL_ID`, `TRIGGER_ID`), CONSTRAINT `WM_POOL_TO_TRIGGER_FK1` FOREIGN KEY (`POOL_ID`) REFERENCES `WM_POOL` (`POOL_ID`), CONSTRAINT `WM_POOL_TO_TRIGGER_FK2` FOREIGN KEY (`TRIGGER_ID`) REFERENCES `WM_TRIGGER` (`TRIGGER_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -------------- ERROR 1215 (HY000): Cannot add foreign key constraint -------------- CREATE TABLE WM_MAPPING ( `MAPPING_ID` bigint(20) NOT NULL, `RP_ID` bigint(20) NOT NULL, `ENTITY_TYPE` varchar(10) NOT NULL, `ENTITY_NAME` varchar(128) NOT NULL, `POOL_ID` bigint(20) NOT NULL, `ORDERING int, PRIMARY KEY (`MAPPING_ID`), KEY `UNIQUE_WM_MAPPING` (`RP_ID`, `ENTITY_TYPE`, `ENTITY_NAME`), CONSTRAINT `WM_MAPPING_FK1` FOREIGN KEY (`RP_ID`) REFERENCES `WM_RESOURCEPLAN` (`RP_ID`), CONSTRAINT `WM_MAPPING_FK2` FOREIGN KEY (`POOL_ID`) REFERENCES `WM_POOL` (`POOL_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -------------- ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAPPING_ID`), KEY `UNIQUE_WM_MAPPING` (`RP_ID`, `ENTITY_TYPE`, `ENTITY_NAME`' at line 8 -------------- UPDATE VERSION SET SCHEMA_VERSION='3.0.0', VERSION_COMMENT='Hive release version 3.0.0' where VER_ID=1 {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)