hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ngan...@apache.org
Subject hive git commit: HIVE-17333 Oracle does not allow change from VARCHAR2 to CLOB for upgrade (Naveen Gangam, reviewed by Aihua Xu)
Date Thu, 07 Dec 2017 15:25:50 GMT
Repository: hive
Updated Branches:
  refs/heads/master 7ddd915bf -> 36f0d89f0


HIVE-17333 Oracle does not allow change from VARCHAR2 to CLOB for upgrade (Naveen Gangam,
reviewed by Aihua Xu)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/36f0d89f
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/36f0d89f
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/36f0d89f

Branch: refs/heads/master
Commit: 36f0d89f0a175e65c68b2b55458a81c6cf9da197
Parents: 7ddd915
Author: Naveen Gangam <ngangam@apache.org>
Authored: Thu Dec 7 10:15:38 2017 -0500
Committer: Naveen Gangam <ngangam@apache.org>
Committed: Thu Dec 7 10:25:25 2017 -0500

----------------------------------------------------------------------
 .../upgrade/oracle/039-HIVE-12274.oracle.sql    | 27 +++++++++++++++-----
 1 file changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/36f0d89f/metastore/scripts/upgrade/oracle/039-HIVE-12274.oracle.sql
----------------------------------------------------------------------
diff --git a/metastore/scripts/upgrade/oracle/039-HIVE-12274.oracle.sql b/metastore/scripts/upgrade/oracle/039-HIVE-12274.oracle.sql
index 4080685..af35684 100644
--- a/metastore/scripts/upgrade/oracle/039-HIVE-12274.oracle.sql
+++ b/metastore/scripts/upgrade/oracle/039-HIVE-12274.oracle.sql
@@ -1,8 +1,23 @@
 -- change PARAM_VALUE to CLOBs
-ALTER TABLE COLUMNS_V2 MODIFY (TYPE_NAME CLOB);;
-ALTER TABLE TABLE_PARAMS MODIFY (PARAM_VALUE CLOB);
-ALTER TABLE SERDE_PARAMS MODIFY (PARAM_VALUE CLOB);
-ALTER TABLE SD_PARAMS MODIFY (PARAM_VALUE CLOB);
+ALTER TABLE COLUMNS_V2 ADD (TEMP CLOB);
+UPDATE COLUMNS_V2 SET TEMP=TYPE_NAME;
+ALTER TABLE COLUMNS_V2 DROP COLUMN TYPE_NAME;
+ALTER TABLE COLUMNS_V2 RENAME COLUMN TEMP TO TYPE_NAME;
+
+ALTER TABLE TABLE_PARAMS ADD (TEMP CLOB);
+UPDATE TABLE_PARAMS SET TEMP=PARAM_VALUE, PARAM_VALUE=NULL;
+ALTER TABLE TABLE_PARAMS DROP COLUMN PARAM_VALUE;
+ALTER TABLE TABLE_PARAMS RENAME COLUMN TEMP TO PARAM_VALUE;
+
+ALTER TABLE SERDE_PARAMS ADD (TEMP CLOB);
+UPDATE SERDE_PARAMS SET TEMP=PARAM_VALUE, PARAM_VALUE=NULL;
+ALTER TABLE SERDE_PARAMS DROP COLUMN PARAM_VALUE;
+ALTER TABLE SERDE_PARAMS RENAME COLUMN TEMP TO PARAM_VALUE;
+
+ALTER TABLE SD_PARAMS ADD (TEMP CLOB);
+UPDATE SD_PARAMS SET TEMP=PARAM_VALUE, PARAM_VALUE=NULL;
+ALTER TABLE SD_PARAMS DROP COLUMN PARAM_VALUE;
+ALTER TABLE SD_PARAMS RENAME COLUMN TEMP TO PARAM_VALUE;
 
 -- Expand the hive table name length to 256
 ALTER TABLE TBLS MODIFY (TBL_NAME VARCHAR2(256));
@@ -13,9 +28,9 @@ ALTER TABLE PART_COL_STATS MODIFY (TABLE_NAME VARCHAR2(256));
 ALTER TABLE COMPLETED_TXN_COMPONENTS MODIFY (CTC_TABLE VARCHAR2(256));
 
 -- Expand the hive column name length to 767
-ALTER TABLE COLUMNS_V2 MODIFY (COLUMN_NAME VARCHAR(767) NOT NULL);
+ALTER TABLE COLUMNS_V2 MODIFY (COLUMN_NAME VARCHAR(767));
 ALTER TABLE PART_COL_PRIVS MODIFY (COLUMN_NAME VARCHAR2(767));
 ALTER TABLE TBL_COL_PRIVS MODIFY (COLUMN_NAME VARCHAR2(767));
 ALTER TABLE SORT_COLS MODIFY (COLUMN_NAME VARCHAR2(767));
 ALTER TABLE TAB_COL_STATS MODIFY (COLUMN_NAME VARCHAR2(767));
-ALTER TABLE PART_COL_STATS MODIFY (COLUMN_NAME VARCHAR2(767) NOT NULL);
+ALTER TABLE PART_COL_STATS MODIFY (COLUMN_NAME VARCHAR2(767));


Mime
View raw message