Repository: hive Updated Branches: refs/heads/master 198487557 -> 5f993e24c
HIVE-20298 : Illegal null value in column `TBLS`.`WRITE_ID` (Sergey Shelukhin, reviewed by Jason Dere) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/5f993e24 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/5f993e24 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/5f993e24 Branch: refs/heads/master Commit: 5f993e24ce7410fd95873b3d39a1a4b846d9d827 Parents: 1984875 Author: sergey <[email protected]> Authored: Tue Aug 14 13:36:57 2018 -0700 Committer: sergey <[email protected]> Committed: Tue Aug 14 13:37:13 2018 -0700 ---------------------------------------------------------------------- .../src/main/sql/mssql/hive-schema-4.0.0.mssql.sql | 4 ++-- .../src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql | 4 ++-- .../src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql | 4 ++-- .../src/main/sql/oracle/hive-schema-4.0.0.oracle.sql | 4 ++-- .../src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql | 4 ++-- .../src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/5f993e24/standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql b/standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql index 538c488..91ba134 100644 --- a/standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql +++ b/standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0.mssql.sql @@ -146,7 +146,7 @@ CREATE TABLE PARTITIONS PART_NAME nvarchar(767) NULL, SD_ID bigint NULL, TBL_ID bigint NULL, - WRITE_ID bigint NULL); + WRITE_ID bigint NOT NULL DEFAULT 0); ALTER TABLE PARTITIONS ADD CONSTRAINT PARTITIONS_PK PRIMARY KEY (PART_ID); @@ -377,7 +377,7 @@ CREATE TABLE TBLS VIEW_EXPANDED_TEXT text NULL, VIEW_ORIGINAL_TEXT text NULL, IS_REWRITE_ENABLED bit NOT NULL DEFAULT 0, - WRITE_ID bigint NULL); + WRITE_ID bigint NOT NULL DEFAULT 0); ALTER TABLE TBLS ADD CONSTRAINT TBLS_PK PRIMARY KEY (TBL_ID); http://git-wip-us.apache.org/repos/asf/hive/blob/5f993e24/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql b/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql index 1d8fc55..f0d861b 100644 --- a/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql +++ b/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql @@ -1,8 +1,8 @@ SELECT 'Upgrading MetaStore schema from 3.2.0 to 4.0.0' AS MESSAGE; -- HIVE-19416 -ALTER TABLE TBLS ADD WRITE_ID bigint NULL; -ALTER TABLE PARTITIONS ADD WRITE_ID bigint NULL; +ALTER TABLE TBLS ADD WRITE_ID bigint NOT NULL DEFAULT 0; +ALTER TABLE PARTITIONS ADD WRITE_ID bigint NOT NULL DEFAULT 0; -- These lines need to be last. Insert any changes above. UPDATE VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1; http://git-wip-us.apache.org/repos/asf/hive/blob/5f993e24/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql b/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql index 79e72ab..ee0f691 100644 --- a/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql +++ b/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql @@ -1,8 +1,8 @@ SELECT 'Upgrading MetaStore schema from 3.2.0 to 4.0.0' AS ' '; -- HIVE-19416 -ALTER TABLE TBLS ADD WRITE_ID bigint; -ALTER TABLE PARTITIONS ADD WRITE_ID bigint; +ALTER TABLE TBLS ADD WRITE_ID bigint DEFAULT 0; +ALTER TABLE PARTITIONS ADD WRITE_ID bigint DEFAULT 0; -- These lines need to be last. Insert any changes above. UPDATE VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1; http://git-wip-us.apache.org/repos/asf/hive/blob/5f993e24/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 213e23b..2c5d6b2 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 @@ -164,7 +164,7 @@ CREATE TABLE PARTITIONS PART_NAME VARCHAR2(767) NULL, SD_ID NUMBER NULL, TBL_ID NUMBER NULL, - WRITE_ID NUMBER NULL + WRITE_ID NUMBER DEFAULT 0 NOT NULL ); ALTER TABLE PARTITIONS ADD CONSTRAINT PARTITIONS_PK PRIMARY KEY (PART_ID); @@ -400,7 +400,7 @@ CREATE TABLE TBLS VIEW_EXPANDED_TEXT CLOB NULL, VIEW_ORIGINAL_TEXT CLOB NULL, IS_REWRITE_ENABLED NUMBER(1) DEFAULT 0 NOT NULL CHECK (IS_REWRITE_ENABLED IN (1,0)), - WRITE_ID NUMBER NULL + WRITE_ID NUMBER DEFAULT 0 NOT NULL ); ALTER TABLE TBLS ADD CONSTRAINT TBLS_PK PRIMARY KEY (TBL_ID); http://git-wip-us.apache.org/repos/asf/hive/blob/5f993e24/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql b/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql index aa20a49..bbb4a39 100644 --- a/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql +++ b/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql @@ -1,7 +1,7 @@ SELECT 'Upgrading MetaStore schema from 3.2.0 to 4.0.0' AS Status from dual; -ALTER TABLE TBLS ADD WRITE_ID number NULL; -ALTER TABLE PARTITIONS ADD WRITE_ID number NULL; +ALTER TABLE TBLS ADD WRITE_ID number DEFAULT 0 NOT NULL; +ALTER TABLE PARTITIONS ADD WRITE_ID number DEFAULT 0 NOT NULL; -- These lines need to be last. Insert any changes above. UPDATE VERSION SET SCHEMA_VERSION='4.0.0', VERSION_COMMENT='Hive release version 4.0.0' where VER_ID=1; http://git-wip-us.apache.org/repos/asf/hive/blob/5f993e24/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql b/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql index f7232a1..2a2d70a 100644 --- a/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql +++ b/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-3.2.0-to-4.0.0.postgres.sql @@ -1,8 +1,8 @@ SELECT 'Upgrading MetaStore schema from 3.2.0 to 4.0.0'; -- HIVE-19416 -ALTER TABLE "TBLS" ADD "WRITE_ID" bigint; -ALTER TABLE "PARTITIONS" ADD "WRITE_ID" bigint; +ALTER TABLE "TBLS" ADD "WRITE_ID" bigint DEFAULT 0; +ALTER TABLE "PARTITIONS" ADD "WRITE_ID" bigint DEFAULT 0; -- These lines need to be last. Insert any changes above. UPDATE "VERSION" SET "SCHEMA_VERSION"='4.0.0', "VERSION_COMMENT"='Hive release version 4.0.0' where "VER_ID"=1;
