dengzhhu653 commented on code in PR #5883: URL: https://github.com/apache/hive/pull/5883#discussion_r2160213456
########## 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: I think there is no difference. In MetastoreDirectSql, we also use `group by` to get the unique `CD_ID`: https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java#L3087 -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org