[ https://issues.apache.org/jira/browse/HIVE-25032?focusedWorklogId=851353&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-851353 ]
ASF GitHub Bot logged work on HIVE-25032: ----------------------------------------- Author: ASF GitHub Bot Created on: 16/Mar/23 13:16 Start Date: 16/Mar/23 13:16 Worklog Time Spent: 10m Work Description: henrib commented on code in PR #4028: URL: https://github.com/apache/hive/pull/4028#discussion_r1138646065 ########## standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Msck.java: ########## @@ -589,17 +593,22 @@ public Void execute(int size) throws MetastoreException { } private List<Pair<Integer, byte[]>> getPartitionExpr(final List<String> parts) throws MetaException { - List<Pair<Integer, byte[]>> expr = new ArrayList<>(parts.size()); + StringBuilder exprBuilder = new StringBuilder(); + String orExpr = " OR "; for (int i = 0; i < parts.size(); i++) { Review Comment: A more 'common' way might be: ``` StringBuilder exprBuilder = new StringBuilder(); for (int i = 0; i < parts.size(); ++i) { if (i > 0) { exprBuilder.append(" OR "); } .... } ``` Issue Time Tracking ------------------- Worklog Id: (was: 851353) Time Spent: 4h 40m (was: 4.5h) > Optimise PartitionManagementTask > -------------------------------- > > Key: HIVE-25032 > URL: https://issues.apache.org/jira/browse/HIVE-25032 > Project: Hive > Issue Type: Improvement > Reporter: Rajesh Balamohan > Assignee: Zhihua Deng > Priority: Major > Labels: pull-request-available > Time Spent: 4h 40m > Remaining Estimate: 0h > > When large number of tables and dbs are present, it takes lot of time to > iterate over all tables in PartitionManagementTask. > If table parameters are populated in TableMeta, it will cut down lots of > interactions with HMS in PartitionManagementTask. > > Code Ref: > [https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PartitionManagementTask.java#L126] > > [https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PartitionManagementTask.java#L132] > -- This message was sent by Atlassian Jira (v8.20.10#820010)