-- 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" DROP PRIMARY KEY;
ALTER TABLE "COLUMNS" ADD PRIMARY KEY ("SD_ID", "COLUMN_NAME");
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 "PARTITION_PARAMS" ALTER "PARAM_VALUE" SET DATA TYPE VARCHAR(4000);
