suneet-s commented on a change in pull request #10340:
URL: https://github.com/apache/druid/pull/10340#discussion_r483061296
##########
File path:
extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorCollector.java
##########
@@ -60,11 +60,11 @@ public static VarianceAggregatorCollector from(ByteBuffer
buffer)
}
public static final Comparator<VarianceAggregatorCollector> COMPARATOR =
(o1, o2) -> {
- int compare = Longs.compare(o1.count, o2.count);
+ int compare = Doubles.compare(o1.nvariance, o2.nvariance);
Review comment:
I think so. I based this on the comment against the `nvariance` variable
```
double nvariance; // sum[x-avg^2] (this is actually n times of the variance)
```
`getVariance(isVariancePop)` looks like it divides by the count to get
variance instead of n * variance.
----------------------------------------------------------------
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]