Copilot commented on code in PR #16888:
URL: https://github.com/apache/pinot/pull/16888#discussion_r2378182778
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/stats/MapColumnPreIndexStatsCollector.java:
##########
@@ -153,7 +153,7 @@ public void seal() {
FieldSpec valueFieldSpec = _colFieldSpec.getChildFieldSpec("value");
for (Map.Entry<String, Integer> entry : _keyFrequencies.entrySet()) {
if (entry.getValue() < _totalNumberOfEntries) {
-
_keyStats.get(entry.getKey()).collect(valueFieldSpec.getDefaultNullValue());
+
_keyStats.get(entry.getKey()).collect(_keyStats.get(entry.getKey())._fieldSpec.getDefaultNullValue());
Review Comment:
The expression `_keyStats.get(entry.getKey())` is called twice in the same
line, which is inefficient. Consider storing the result in a local variable to
avoid the duplicate map lookup.
```suggestion
AbstractColumnStatisticsCollector keyStatsCollector =
_keyStats.get(entry.getKey());
keyStatsCollector.collect(keyStatsCollector._fieldSpec.getDefaultNullValue());
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]