You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "henrib (via GitHub)" <gi...@apache.org> on 2023/03/16 13:16:52 UTC

[GitHub] [hive] henrib commented on a diff in pull request #4028: HIVE-25032: Optimise PartitionManagementTask

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 ");
                }
               ....
           }
   ```



-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org