shenyu0127 commented on code in PR #11365:
URL: https://github.com/apache/pinot/pull/11365#discussion_r1299602323


##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/VarianceAggregationFunction.java:
##########
@@ -134,12 +169,7 @@ public void aggregateGroupByMV(int length, int[][] 
groupKeysArray, GroupByResult
 
   @Override
   public VarianceTuple extractAggregationResult(AggregationResultHolder 
aggregationResultHolder) {
-    VarianceTuple varianceTuple = aggregationResultHolder.getResult();
-    if (varianceTuple == null) {
-      return new VarianceTuple(0L, 0.0, 0.0);
-    } else {
-      return varianceTuple;
-    }
+    return aggregationResultHolder.getResult();

Review Comment:
   We don't need to check if `_nullHandlingEnabled` is set here. This is 
because we want to return NULL (not `-infi`) if `_nullHandlingEnabled` is false 
and no matching row is found.
   
   There was a bug in my previous commit: if `_nullHandlingEnabled` is false 
and no matching row is found, it would return NaN. I fixed it by modifying 
other places.



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

Reply via email to