Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
When computing statistics using the statistics component, the value for max may be reported incorrectly if the maximum value does not lie in the first shard.
This is where the problem is:
StatsValuesFactory.java
@Override protected void updateMinMax(Date min, Date max) { if(this.min==null || this.min.after(min)) { this.min = min; } if(this.max==null || this.max.before(min)) { this.max = max; } }
Attached is a one-line patch which fixes this issue.
Ugh...
Brett: thanks for reporting this.
I've updated your patch to account for the fact that min/max might be null coming back from a shard. When updating the existing distributed stats test to also include date fields to trigger this problem, I uncovered another glitch in how the sum/stddev are computed (sum was inited to "-1" for some bizare reason) which is also fixed in this updated patch.