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


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DirectSqlUpdatePart.java:
##########
@@ -892,18 +892,25 @@ public List<Void> run(List<Long> input) throws Exception {
         sdIdToNewCdId.containsKey(sdId) ? sdIdToNewCdId.get(sdId) : cdId);
     updateSDInBatch(validSdIds, idToSd, sdIdToCdId);
 
-    List<Long> usedIds = Batchable.runBatched(maxBatchSize, cdIdsMayDelete,
+    Set<Long> usedIds = new HashSet<>(Batchable.runBatched(maxBatchSize, 
cdIdsMayDelete,
         new Batchable<Long, Long>() {
           @Override
           public List<Long> run(List<Long> input) throws Exception {
             String idLists = MetaStoreDirectSql.getIdListForIn(input);
-            String queryText = "select \"CD_ID\" from \"SDS\" where \"CD_ID\" 
in ( " + idLists + ")";
+            String queryText = "select \"CD_ID\" from \"SDS\" where \"CD_ID\" 
in ( "

Review Comment:
   
https://www.linkedin.com/pulse/optimizing-sql-performance-distinct-vs-group-fact-analysis-rahman-z5sec/
   For relational DBs, `SELECT DISTINCT`  is typically faster or at least 
simpler than `GROUP BY`



-- 
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