jackjlli commented on code in PR #11346:
URL: https://github.com/apache/pinot/pull/11346#discussion_r1330810915
##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/DistinctCountHLLPlusAggregationFunction.java:
##########
@@ -96,16 +96,12 @@ public void aggregate(int length, AggregationResultHolder
aggregationResultHolde
byte[][] bytesValues = blockValSet.getBytesValuesSV();
try {
HyperLogLogPlus hyperLogLogPlus = aggregationResultHolder.getResult();
- if (hyperLogLogPlus != null) {
- for (int i = 0; i < length; i++) {
-
hyperLogLogPlus.addAll(ObjectSerDeUtils.HYPER_LOG_LOG_PLUS_SER_DE.deserialize(bytesValues[i]));
- }
- } else {
+ if (hyperLogLogPlus == null) {
hyperLogLogPlus =
ObjectSerDeUtils.HYPER_LOG_LOG_PLUS_SER_DE.deserialize(bytesValues[0]);
aggregationResultHolder.setValue(hyperLogLogPlus);
- for (int i = 1; i < length; i++) {
-
hyperLogLogPlus.addAll(ObjectSerDeUtils.HYPER_LOG_LOG_PLUS_SER_DE.deserialize(bytesValues[i]));
- }
+ }
+ for (int i = 0; i < length; i++) {
Review Comment:
nit: `int i = 1;`
--
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]