belugabehr commented on a change in pull request #1067:
URL: https://github.com/apache/hive/pull/1067#discussion_r436051831
##########
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:
Thanks @t3rmin4t0r for the review! I'm not sure the value of that. Are
there many instances where organizations are running with something higher than
INFO? If it's expected to run at INFO, better to just concat and print the
message than to have to do the actions of parsing the string, looking for the
anchor `{}`, replacing it, etc. etc. I am happy to do it just for consistency,
but from performance, better to simply concat and print.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]