Skip to content

Conversation

@not-napoleon
Copy link
Member

This ports in a unit test for #19528 (which is really just the unit test @colings86 submitted to the upstream library last year, retouched for our randomized testing framework). As far as I can tell, this issue has been fixed since we migrated to t-digest 3.2, and this test should just pass. My recommendation is to include the test in our suite for regression testing, and close #19528

@cbuescher cbuescher added >test Issues or PRs that are addressing/adding tests :Analytics/Aggregations Aggregations labels Dec 2, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

Copy link
Contributor

@polyfractal polyfractal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few style comments but otherwise LGTM!

I didn't really review the actual test logic since it's a port and I'm assuming Colin knew what he was doing at the time :)

@@ -0,0 +1,35 @@
package org.elasticsearch.search.aggregations.metrics;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing license header, will make checkstyle unhappy :)

double prev = Double.NEGATIVE_INFINITY;
for (double q : quantiles) {
final double v = digest.quantile(q);
System.out.println("q=" + q + ", v=" + v);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to use a logger instead of printing directly to console. Logged under debug or trace I would guess?

import java.util.Arrays;

public class TDigestStateTests extends ESTestCase {
@Test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't really matter, but I don't think you need the test annotation here. I believe our tests are setup to just run anything that starts with "test". (Looks like this is just a carry-over from how the TDigest library tests things)

@not-napoleon not-napoleon merged commit ce7b188 into elastic:master Dec 5, 2018
@not-napoleon not-napoleon deleted the fix/19528-large-percentile-aggregation-anomaly branch December 5, 2018 15:56
not-napoleon added a commit that referenced this pull request Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Aggregations Aggregations >test Issues or PRs that are addressing/adding tests v6.6.0 v7.0.0-beta1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

percentiles aggregation return anomaly value when hits too large

5 participants