[ 
https://issues.apache.org/jira/browse/HIVE-25032?focusedWorklogId=851358&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-851358
 ]

ASF GitHub Bot logged work on HIVE-25032:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Mar/23 13:25
            Start Date: 16/Mar/23 13:25
    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 (that will avoid declaring, adding and removing 
orExpr):
            ```
   StringBuilder exprBuilder = new StringBuilder();
            for (int i = 0; i < parts.size(); ++i) {
                if (i > 0) {
                    exprBuilder.append(" OR ");
                }
               ....
           }
   ```





Issue Time Tracking
-------------------

    Worklog Id:     (was: 851358)
    Time Spent: 5h  (was: 4h 50m)

> 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: 5h
>  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)

Reply via email to