This is an automated email from the ASF dual-hosted git repository.

dengzh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 7e5b5de9eba HIVE-27555: Upgrade issues with Kudu table on backend db 
(#4872) (Zhihua Deng, reviewed by Attila Turoczy, Denys Kuzmenko)
7e5b5de9eba is described below

commit 7e5b5de9ebaad037b81eb1a581013db88fac6c51
Author: dengzh <[email protected]>
AuthorDate: Sat Dec 9 18:06:55 2023 +0800

    HIVE-27555: Upgrade issues with Kudu table on backend db (#4872) (Zhihua 
Deng, reviewed by Attila Turoczy, Denys Kuzmenko)
---
 .../upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.derby.sql      | 16 ++++++++++------
 .../upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.mssql.sql      | 16 ++++++++++------
 .../upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.mysql.sql      | 16 ++++++++++------
 .../upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.oracle.sql     | 16 ++++++++++------
 .../upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.postgres.sql   | 16 ++++++++++------
 5 files changed, 50 insertions(+), 30 deletions(-)

diff --git 
a/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.derby.sql
 
b/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.derby.sql
index d24722518a2..b1773254107 100644
--- 
a/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.derby.sql
+++ 
b/standalone-metastore/metastore-server/src/main/sql/derby/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.derby.sql
@@ -31,18 +31,22 @@ ALTER TABLE "APP"."METASTORE_DB_PROPERTIES" ADD 
PROPERTYCONTENT BLOB;
 
 -- HIVE-27457
 UPDATE "SDS"
-    SET "SDS"."INPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduInputFormat',
-        "SDS"."OUTPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduOutputFormat'
-    WHERE "SDS"."SD_ID" IN (
-        SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE "PARAM_VALUE" LIKE 
'%KuduStorageHandler%'
+    SET "INPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduInputFormat', 
"OUTPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduOutputFormat'
+    WHERE "SD_ID" IN (
+        SELECT "TBLS"."SD_ID"
+            FROM "TBLS"
+            INNER JOIN "TABLE_PARAMS" ON "TBLS"."TBL_ID" = 
"TABLE_PARAMS"."TBL_ID"
+            WHERE "TABLE_PARAMS"."PARAM_VALUE" LIKE '%KuduStorageHandler%'
     );
+
 UPDATE "SERDES"
     SET "SERDES"."SLIB" = 'org.apache.hadoop.hive.kudu.KuduSerDe'
     WHERE "SERDE_ID" IN (
         SELECT "SDS"."SERDE_ID"
             FROM "TBLS"
-            LEFT JOIN "SDS" ON "TBLS"."SD_ID" = "SDS"."SD_ID"
-            WHERE "TBL_ID" IN (SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE 
"PARAM_VALUE" LIKE '%KuduStorageHandler%')
+            INNER JOIN "SDS" ON "TBLS"."SD_ID" = "SDS"."SD_ID"
+            INNER JOIN "TABLE_PARAMS" ON "TBLS"."TBL_ID" = 
"TABLE_PARAMS"."TBL_ID"
+            WHERE "TABLE_PARAMS"."PARAM_VALUE" LIKE '%KuduStorageHandler%'
     );
 
 -- This needs to be the last thing done.  Insert any changes above this line.
diff --git 
a/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.mssql.sql
 
b/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.mssql.sql
index 5712d24847b..e4253ac1ff9 100644
--- 
a/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.mssql.sql
+++ 
b/standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.mssql.sql
@@ -31,18 +31,22 @@ ALTER TABLE METASTORE_DB_PROPERTIES ADD PROPERTYCONTENT 
varbinary(max);
 
 -- HIVE-27457
 UPDATE "SDS"
-    SET "SDS"."INPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduInputFormat',
-        "SDS"."OUTPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduOutputFormat'
-    WHERE "SDS"."SD_ID" IN (
-        SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE "PARAM_VALUE" LIKE 
'%KuduStorageHandler%'
+    SET "INPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduInputFormat', 
"OUTPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduOutputFormat'
+    WHERE "SD_ID" IN (
+        SELECT "TBLS"."SD_ID"
+            FROM "TBLS"
+            INNER JOIN "TABLE_PARAMS" ON "TBLS"."TBL_ID" = 
"TABLE_PARAMS"."TBL_ID"
+            WHERE "TABLE_PARAMS"."PARAM_VALUE" LIKE '%KuduStorageHandler%'
     );
+
 UPDATE "SERDES"
     SET "SERDES"."SLIB" = 'org.apache.hadoop.hive.kudu.KuduSerDe'
     WHERE "SERDE_ID" IN (
         SELECT "SDS"."SERDE_ID"
             FROM "TBLS"
-            LEFT JOIN "SDS" ON "TBLS"."SD_ID" = "SDS"."SD_ID"
-            WHERE "TBL_ID" IN (SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE 
"PARAM_VALUE" LIKE '%KuduStorageHandler%')
+            INNER JOIN "SDS" ON "TBLS"."SD_ID" = "SDS"."SD_ID"
+            INNER JOIN "TABLE_PARAMS" ON "TBLS"."TBL_ID" = 
"TABLE_PARAMS"."TBL_ID"
+            WHERE "TABLE_PARAMS"."PARAM_VALUE" LIKE '%KuduStorageHandler%'
     );
 
 -- These lines need to be last.  Insert any changes above.
diff --git 
a/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.mysql.sql
 
b/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.mysql.sql
index fee7042115f..0d4b2274761 100644
--- 
a/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.mysql.sql
+++ 
b/standalone-metastore/metastore-server/src/main/sql/mysql/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.mysql.sql
@@ -32,18 +32,22 @@ ALTER TABLE METASTORE_DB_PROPERTIES ADD PROPERTYCONTENT 
blob;
 
 -- HIVE-27457
 UPDATE SDS
-    SET SDS.INPUT_FORMAT = "org.apache.hadoop.hive.kudu.KuduInputFormat",
-        SDS.OUTPUT_FORMAT = "org.apache.hadoop.hive.kudu.KuduOutputFormat"
-    WHERE SDS.SD_ID IN (
-        SELECT TBL_ID FROM TABLE_PARAMS WHERE PARAM_VALUE LIKE 
'%KuduStorageHandler%'
+    SET INPUT_FORMAT = 'org.apache.hadoop.hive.kudu.KuduInputFormat', 
OUTPUT_FORMAT = 'org.apache.hadoop.hive.kudu.KuduOutputFormat'
+    WHERE SD_ID IN (
+        SELECT TBLS.SD_ID
+            FROM TBLS
+            INNER JOIN TABLE_PARAMS ON TBLS.TBL_ID = TABLE_PARAMS.TBL_ID
+            WHERE PARAM_VALUE LIKE '%KuduStorageHandler%'
     );
+
 UPDATE SERDES
     SET SERDES.SLIB = "org.apache.hadoop.hive.kudu.KuduSerDe"
     WHERE SERDE_ID IN (
         SELECT SDS.SERDE_ID
             FROM TBLS
-            LEFT JOIN SDS ON TBLS.SD_ID = SDS.SD_ID
-            WHERE TBL_ID IN (SELECT TBL_ID FROM TABLE_PARAMS WHERE PARAM_VALUE 
LIKE '%KuduStorageHandler%')
+            INNER JOIN SDS ON TBLS.SD_ID = SDS.SD_ID
+            INNER JOIN TABLE_PARAMS ON TBLS.TBL_ID = TABLE_PARAMS.TBL_ID
+            WHERE TABLE_PARAMS.PARAM_VALUE LIKE '%KuduStorageHandler%'
     );
 
 -- These lines need to be last.  Insert any changes above.
diff --git 
a/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.oracle.sql
 
b/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.oracle.sql
index 1e25c1271c1..781609ee1db 100644
--- 
a/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.oracle.sql
+++ 
b/standalone-metastore/metastore-server/src/main/sql/oracle/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.oracle.sql
@@ -31,18 +31,22 @@ ALTER TABLE METASTORE_DB_PROPERTIES ADD PROPERTYCONTENT 
BLOB;
 
 -- HIVE-27457
 UPDATE "SDS"
-    SET "SDS"."INPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduInputFormat',
-        "SDS"."OUTPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduOutputFormat'
-    WHERE "SDS"."SD_ID" IN (
-        SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE "PARAM_VALUE" LIKE 
'%KuduStorageHandler%'
+    SET "INPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduInputFormat', 
"OUTPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduOutputFormat'
+    WHERE "SD_ID" IN (
+        SELECT "TBLS"."SD_ID"
+            FROM "TBLS"
+            INNER JOIN "TABLE_PARAMS" ON "TBLS"."TBL_ID" = 
"TABLE_PARAMS"."TBL_ID"
+            WHERE "TABLE_PARAMS"."PARAM_VALUE" LIKE '%KuduStorageHandler%'
     );
+
 UPDATE "SERDES"
     SET "SERDES"."SLIB" = 'org.apache.hadoop.hive.kudu.KuduSerDe'
     WHERE "SERDE_ID" IN (
         SELECT "SDS"."SERDE_ID"
             FROM "TBLS"
-            LEFT JOIN "SDS" ON "TBLS"."SD_ID" = "SDS"."SD_ID"
-            WHERE "TBL_ID" IN (SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE 
"PARAM_VALUE" LIKE '%KuduStorageHandler%')
+            INNER JOIN "SDS" ON "TBLS"."SD_ID" = "SDS"."SD_ID"
+            INNER JOIN "TABLE_PARAMS" ON "TBLS"."TBL_ID" = 
"TABLE_PARAMS"."TBL_ID"
+            WHERE "TABLE_PARAMS"."PARAM_VALUE" LIKE '%KuduStorageHandler%'
     );
 
 -- These lines need to be last.  Insert any changes above.
diff --git 
a/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.postgres.sql
 
b/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.postgres.sql
index fd6459e234a..d6a3162d842 100644
--- 
a/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.postgres.sql
+++ 
b/standalone-metastore/metastore-server/src/main/sql/postgres/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.postgres.sql
@@ -31,18 +31,22 @@ ALTER TABLE "METASTORE_DB_PROPERTIES" ADD "PROPERTYCONTENT" 
bytea;
 
 -- HIVE-27457
 UPDATE "SDS"
-    SET "INPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduInputFormat',
-        "OUTPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduOutputFormat'
-    WHERE "SDS"."SD_ID" IN (
-        SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE "PARAM_VALUE" LIKE 
'%KuduStorageHandler%'
+    SET "INPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduInputFormat', 
"OUTPUT_FORMAT" = 'org.apache.hadoop.hive.kudu.KuduOutputFormat'
+    WHERE "SD_ID" IN (
+        SELECT "TBLS"."SD_ID"
+            FROM "TBLS"
+            INNER JOIN "TABLE_PARAMS" ON "TBLS"."TBL_ID" = 
"TABLE_PARAMS"."TBL_ID"
+            WHERE "PARAM_VALUE" LIKE '%KuduStorageHandler%'
     );
+
 UPDATE "SERDES"
     SET "SLIB" = 'org.apache.hadoop.hive.kudu.KuduSerDe'
     WHERE "SERDE_ID" IN (
         SELECT "SDS"."SERDE_ID"
             FROM "TBLS"
-            LEFT JOIN "SDS" ON "TBLS"."SD_ID" = "SDS"."SD_ID"
-            WHERE "TBL_ID" IN (SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE 
"PARAM_VALUE" LIKE '%KuduStorageHandler%')
+            INNER JOIN "SDS" ON "TBLS"."SD_ID" = "SDS"."SD_ID"
+            INNER JOIN "TABLE_PARAMS" ON "TBLS"."TBL_ID" = 
"TABLE_PARAMS"."TBL_ID"
+            WHERE "TABLE_PARAMS"."PARAM_VALUE" LIKE '%KuduStorageHandler%'
     );
 
 -- These lines need to be last. Insert any changes above.

Reply via email to