Repository: hive Updated Branches: refs/heads/master 5681647b7 -> 5449dffc2
HIVE-20413: "cannot insert NULL" for TXN_WRITE_NOTIFICATION_LOG in Oracle (Daniel Dai, reviewed by Thejas Nair) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/5449dffc Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/5449dffc Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/5449dffc Branch: refs/heads/master Commit: 5449dffc2cb3d0b9c0ba22eadc98d72f6d561d55 Parents: 5681647 Author: Daniel Dai <dai...@gmail.com> Authored: Fri Aug 17 14:34:26 2018 -0700 Committer: Daniel Dai <dai...@gmail.com> Committed: Fri Aug 17 14:34:26 2018 -0700 ---------------------------------------------------------------------- .../src/main/sql/oracle/hive-schema-3.2.0.oracle.sql | 7 ++++--- .../src/main/sql/oracle/hive-schema-4.0.0.oracle.sql | 7 ++++--- .../src/main/sql/oracle/upgrade-3.1.0-to-3.2.0.oracle.sql | 8 +++++--- 3 files changed, 13 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/5449dffc/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-3.2.0.oracle.sql ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-3.2.0.oracle.sql b/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-3.2.0.oracle.sql index 886570a..c0df830 100644 --- a/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-3.2.0.oracle.sql +++ b/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-3.2.0.oracle.sql @@ -1159,14 +1159,15 @@ CREATE TABLE TXN_WRITE_NOTIFICATION_LOG ( WNL_WRITEID number(19) NOT NULL, WNL_DATABASE varchar(128) NOT NULL, WNL_TABLE varchar(128) NOT NULL, - WNL_PARTITION varchar(767) NOT NULL, + WNL_PARTITION varchar(767), WNL_TABLE_OBJ clob NOT NULL, WNL_PARTITION_OBJ clob, WNL_FILES clob, - WNL_EVENT_TIME number(10) NOT NULL, - PRIMARY KEY (WNL_TXNID, WNL_DATABASE, WNL_TABLE, WNL_PARTITION) + WNL_EVENT_TIME number(10) NOT NULL ); +CREATE INDEX TXN_WRITE_NOTIFICATION_LOG_IDX ON TXN_WRITE_NOTIFICATION_LOG (WNL_TXNID, WNL_DATABASE, WNL_TABLE, WNL_PARTITION); + INSERT INTO SEQUENCE_TABLE (SEQUENCE_NAME, NEXT_VAL) VALUES ('org.apache.hadoop.hive.metastore.model.MTxnWriteNotificationLog', 1); -- ----------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/5449dffc/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql b/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql index 2c5d6b2..33aa080 100644 --- a/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql +++ b/standalone-metastore/metastore-server/src/main/sql/oracle/hive-schema-4.0.0.oracle.sql @@ -1161,14 +1161,15 @@ CREATE TABLE TXN_WRITE_NOTIFICATION_LOG ( WNL_WRITEID number(19) NOT NULL, WNL_DATABASE varchar(128) NOT NULL, WNL_TABLE varchar(128) NOT NULL, - WNL_PARTITION varchar(767) NOT NULL, + WNL_PARTITION varchar(767), WNL_TABLE_OBJ clob NOT NULL, WNL_PARTITION_OBJ clob, WNL_FILES clob, - WNL_EVENT_TIME number(10) NOT NULL, - PRIMARY KEY (WNL_TXNID, WNL_DATABASE, WNL_TABLE, WNL_PARTITION) + WNL_EVENT_TIME number(10) NOT NULL ); +CREATE INDEX TXN_WRITE_NOTIFICATION_LOG_IDX ON TXN_WRITE_NOTIFICATION_LOG (WNL_TXNID, WNL_DATABASE, WNL_TABLE, WNL_PARTITION); + INSERT INTO SEQUENCE_TABLE (SEQUENCE_NAME, NEXT_VAL) VALUES ('org.apache.hadoop.hive.metastore.model.MTxnWriteNotificationLog', 1); -- ----------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/5449dffc/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.1.0-to-3.2.0.oracle.sql ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.1.0-to-3.2.0.oracle.sql b/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.1.0-to-3.2.0.oracle.sql index bbf743f..c5e48a1 100644 --- a/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.1.0-to-3.2.0.oracle.sql +++ b/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.1.0-to-3.2.0.oracle.sql @@ -7,13 +7,15 @@ CREATE TABLE TXN_WRITE_NOTIFICATION_LOG ( WNL_WRITEID number(19) NOT NULL, WNL_DATABASE varchar(128) NOT NULL, WNL_TABLE varchar(128) NOT NULL, - WNL_PARTITION varchar(767) NOT NULL, + WNL_PARTITION varchar(767), WNL_TABLE_OBJ clob NOT NULL, WNL_PARTITION_OBJ clob, WNL_FILES clob, - WNL_EVENT_TIME number(10) NOT NULL, - PRIMARY KEY (WNL_TXNID, WNL_DATABASE, WNL_TABLE, WNL_PARTITION) + WNL_EVENT_TIME number(10) NOT NULL ); + +CREATE INDEX TXN_WRITE_NOTIFICATION_LOG_IDX ON TXN_WRITE_NOTIFICATION_LOG (WNL_TXNID, WNL_DATABASE, WNL_TABLE, WNL_PARTITION); + INSERT INTO SEQUENCE_TABLE (SEQUENCE_NAME, NEXT_VAL) VALUES ('org.apache.hadoop.hive.metastore.model.MTxnWriteNotificationLog', 1); -- HIVE-20221