Skip to content

Commit

Permalink
HIVE-27555: Upgrade issues with Kudu table on backend db
Browse files Browse the repository at this point in the history
  • Loading branch information
dengzhhu653 committed Nov 11, 2023
1 parent 9387a2c commit ddcd287
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ 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"
WHERE "TBLS"."TBL_ID" IN (SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE "PARAM_VALUE" LIKE '%KuduStorageHandler%')
);

-- This needs to be the last thing done. Insert any changes above this line.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ 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"
WHERE "TBLS"."TBL_ID" IN (SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE "PARAM_VALUE" LIKE '%KuduStorageHandler%')
);

-- These lines need to be last. Insert any changes above.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@ 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
WHERE TBLS.TBL_ID IN (SELECT TBL_ID FROM TABLE_PARAMS WHERE PARAM_VALUE LIKE '%KuduStorageHandler%')
);

-- These lines need to be last. Insert any changes above.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ 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"
WHERE "TBLS"."TBL_ID" IN (SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE "PARAM_VALUE" LIKE '%KuduStorageHandler%')
);

-- These lines need to be last. Insert any changes above.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,19 @@ 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 "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"
INNER JOIN "SDS" ON "TBLS"."SD_ID" = "SDS"."SD_ID"
WHERE "TBL_ID" IN (SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE "PARAM_VALUE" LIKE '%KuduStorageHandler%')
);

Expand Down

0 comments on commit ddcd287

Please sign in to comment.