deniskuzZ commented on code in PR #4872:
URL: https://github.com/apache/hive/pull/4872#discussion_r1419432930


##########
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,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%')

Review Comment:
   that is exactly what INNER JOIN does + on indexed columns it should be faster
   ````
   INNER JOIN "TABLE_PARAMS" ON "TBLS"."TBL_ID" = "TABLE_PARAMS"."TBL_ID"
   WHERE "TABLE_PARAMS"."PARAM_VALUE" LIKE '%KuduStorageHandler%'
   ````



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to