From 82be4456899a536dcc78ba22bb9303b6fa3f2494 Mon Sep 17 00:00:00 2001 From: Sam An Date: Mon, 12 Aug 2019 20:28:00 -0700 Subject: [PATCH] HIVE-22101: table RUNTIME_STATS Schema Script for Postgres Metastore is wrong (Sam An via Naveen Gangam) --- .../main/sql/postgres/hive-schema-3.0.0.postgres.sql | 12 ++++++------ .../main/sql/postgres/hive-schema-3.1.0.postgres.sql | 12 ++++++------ .../main/sql/postgres/hive-schema-3.2.0.postgres.sql | 12 ++++++------ .../main/sql/postgres/hive-schema-4.0.0.postgres.sql | 12 ++++++------ .../sql/postgres/upgrade-2.3.0-to-3.0.0.postgres.sql | 12 ++++++------ 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.0.0.postgres.sql b/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.0.0.postgres.sql index 3f94f5bb9b..5671892bed 100644 --- a/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.0.0.postgres.sql +++ b/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.0.0.postgres.sql @@ -1815,14 +1815,14 @@ CREATE TABLE REPL_TXN_MAP ( PRIMARY KEY (RTM_REPL_POLICY, RTM_SRC_TXN_ID) ); -CREATE TABLE RUNTIME_STATS ( - RS_ID bigint primary key, - CREATE_TIME bigint NOT NULL, - WEIGHT bigint NOT NULL, - PAYLOAD bytea +CREATE TABLE "RUNTIME_STATS" ( + "RS_ID" bigint primary key, + "CREATE_TIME" bigint NOT NULL, + "WEIGHT" bigint NOT NULL, + "PAYLOAD" bytea ); -CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +CREATE INDEX "IDX_RUNTIME_STATS_CREATE_TIME" ON "RUNTIME_STATS"("CREATE_TIME"); -- ----------------------------------------------------------------- -- Record schema version. Should be the last step in the init script diff --git a/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.1.0.postgres.sql b/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.1.0.postgres.sql index 4d1ae84e1f..c6fbad4e65 100644 --- a/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.1.0.postgres.sql +++ b/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.1.0.postgres.sql @@ -1838,14 +1838,14 @@ CREATE TABLE REPL_TXN_MAP ( ); -CREATE TABLE RUNTIME_STATS ( - RS_ID bigint primary key, - CREATE_TIME bigint NOT NULL, - WEIGHT bigint NOT NULL, - PAYLOAD bytea +CREATE TABLE "RUNTIME_STATS" ( + "RS_ID" bigint primary key, + "CREATE_TIME" bigint NOT NULL, + "WEIGHT" bigint NOT NULL, + "PAYLOAD" bytea ); -CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +CREATE INDEX "IDX_RUNTIME_STATS_CREATE_TIME" ON "RUNTIME_STATS"("CREATE_TIME"); -- ----------------------------------------------------------------- -- Record schema version. Should be the last step in the init script diff --git a/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.2.0.postgres.sql b/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.2.0.postgres.sql index 337b0266f1..f65aa0d1cd 100644 --- a/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.2.0.postgres.sql +++ b/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-3.2.0.postgres.sql @@ -1840,14 +1840,14 @@ CREATE TABLE REPL_TXN_MAP ( ); -CREATE TABLE RUNTIME_STATS ( - RS_ID bigint primary key, - CREATE_TIME bigint NOT NULL, - WEIGHT bigint NOT NULL, - PAYLOAD bytea +CREATE TABLE "RUNTIME_STATS" ( + "RS_ID" bigint primary key, + "CREATE_TIME" bigint NOT NULL, + "WEIGHT" bigint NOT NULL, + "PAYLOAD" bytea ); -CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +CREATE INDEX "IDX_RUNTIME_STATS_CREATE_TIME" ON "RUNTIME_STATS"("CREATE_TIME"); CREATE TABLE "TXN_WRITE_NOTIFICATION_LOG" ( "WNL_ID" bigint NOT NULL, diff --git a/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql b/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql index 087e962da9..dcce86663d 100644 --- a/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql +++ b/standalone-metastore/metastore-server/src/main/sql/postgres/hive-schema-4.0.0.postgres.sql @@ -1847,14 +1847,14 @@ CREATE TABLE REPL_TXN_MAP ( ); -CREATE TABLE RUNTIME_STATS ( - RS_ID bigint primary key, - CREATE_TIME bigint NOT NULL, - WEIGHT bigint NOT NULL, - PAYLOAD bytea +CREATE TABLE "RUNTIME_STATS" ( + "RS_ID" bigint primary key, + "CREATE_TIME" bigint NOT NULL, + "WEIGHT" bigint NOT NULL, + "PAYLOAD" bytea ); -CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +CREATE INDEX "IDX_RUNTIME_STATS_CREATE_TIME" ON "RUNTIME_STATS"("CREATE_TIME"); CREATE TABLE "TXN_WRITE_NOTIFICATION_LOG" ( "WNL_ID" bigint NOT NULL, diff --git a/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-2.3.0-to-3.0.0.postgres.sql b/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-2.3.0-to-3.0.0.postgres.sql index 06e758ccdb..2b9a8cd84e 100644 --- a/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-2.3.0-to-3.0.0.postgres.sql +++ b/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-2.3.0-to-3.0.0.postgres.sql @@ -323,14 +323,14 @@ CREATE TABLE MIN_HISTORY_LEVEL ( CREATE INDEX MIN_HISTORY_LEVEL_IDX ON MIN_HISTORY_LEVEL (MHL_MIN_OPEN_TXNID); -CREATE TABLE RUNTIME_STATS ( - RS_ID bigint primary key, - CREATE_TIME bigint NOT NULL, - WEIGHT bigint NOT NULL, - PAYLOAD bytea +CREATE TABLE "RUNTIME_STATS" ( + "RS_ID" bigint primary key, + "CREATE_TIME" bigint NOT NULL, + "WEIGHT" bigint NOT NULL, + "PAYLOAD" bytea ); -CREATE INDEX IDX_RUNTIME_STATS_CREATE_TIME ON RUNTIME_STATS(CREATE_TIME); +CREATE INDEX "IDX_RUNTIME_STATS_CREATE_TIME" ON "RUNTIME_STATS"("CREATE_TIME"); -- HIVE-18193 -- Populate NEXT_WRITE_ID for each Transactional table and set next write ID same as next txn ID -- 2.20.1