You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/06/05 17:50:09 UTC

[GitHub] [hive] pgaref commented on a change in pull request #1067: HIVE-23627: Review of GroupByOperator

pgaref commented on a change in pull request #1067:
URL: https://github.com/apache/hive/pull/1067#discussion_r436072669



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/GroupByOperator.java
##########
@@ -990,24 +955,17 @@ private void flushHashTable(boolean complete) throws HiveException {
     // changed in the future
 
     if (complete) {
-      Iterator<Map.Entry<KeyWrapper, AggregationBuffer[]>> iter = hashAggregations
-          .entrySet().iterator();
-      while (iter.hasNext()) {
-        Map.Entry<KeyWrapper, AggregationBuffer[]> m = iter.next();
-        forward(m.getKey().getKeyArray(), m.getValue());
+      for (Map.Entry<KeyWrapper, AggregationBuffer[]> entry : hashAggregations.entrySet()) {
+        forward(entry.getKey().getKeyArray(), entry.getValue());
       }
-      hashAggregations.clear();
       hashAggregations = null;
-      if (LOG.isInfoEnabled()) {
-        LOG.info("Hash Table completed flushed");
-      }
+      LOG.info("Hash Table completed flushed");
       return;
     }
 
     int oldSize = hashAggregations.size();
-    if (LOG.isInfoEnabled()) {
-      LOG.info("Hash Tbl flush: #hash table = " + oldSize);
-    }
+    LOG.info("Hash Tbl flush: #hash table = " + oldSize);

Review comment:
       The problem is string concatenation does a lot of work without knowing if it is needed or not -- {} format does not!
   http://slf4j.org/faq.html#logging_performance




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

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