gianm commented on a change in pull request #10340:
URL: https://github.com/apache/druid/pull/10340#discussion_r483158776
##########
File path:
extensions-core/stats/src/main/java/org/apache/druid/query/aggregation/variance/VarianceAggregatorFactory.java
##########
@@ -239,7 +240,9 @@ public Comparator getComparator()
@Override
public Object finalizeComputation(@Nullable Object object)
{
- return object == null ? null : ((VarianceAggregatorCollector)
object).getVariance(isVariancePop);
+ return object == null || ((VarianceAggregatorCollector) object).count == 0
+ ? null
Review comment:
Ah, that comment is out of date. It used to be true but now timeseries
queries can return a single row, SQL-style, even if there's no input data.
There's a test for it in TImeseriesQueryRunnerTest -> testEmptyTimeseries. It
looks like it's expecting `NullHandling.defaultDoubleValue()` for the
aggregators it tests.
----------------------------------------------------------------
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]