-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Add coerce setting to histogram field mapper #137191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
...lytics/src/test/java/org/elasticsearch/xpack/analytics/mapper/HistogramFieldMapperTests.java
Outdated
Show resolved
Hide resolved
...ytics/src/main/java/org/elasticsearch/xpack/analytics/mapper/ExponentialHistogramParser.java
Outdated
Show resolved
Hide resolved
...alytics/src/main/java/org/elasticsearch/xpack/analytics/mapper/ParsedHistogramConverter.java
Show resolved
Hide resolved
| } catch (IOException e) { | ||
| throw new RuntimeException(e); | ||
| } | ||
| return new HistogramParser.ParsedHistogram(values, counts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So here you're cloning the implementation.. Maybe we should just verify that we get the numbers we're expecting, instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe check that some percentile values are close enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the fact that we delegate to ParsedHistogramConverter.exponentialToTDigest in the tests?
This is intentional. This unit test is not supposed to verify the correctness of the conversion algorithm, that is done by ParsedHistogramConverterTests. These keeps the tests small, while not loosing out on coverage
Part of #136605.
Adds a
coerceparameter to the classichistogramfield mapper, which is for now hidden behind the exponential-histograms feature flag. Whencoerceis enabled (which it is by default),histogramfields will also acceptexponential_histogramJSON and convert it to T-Digests like we do in both the EDOT collector and in the elasticsearch OTLP-endpoint.The added tests are randomized, I've ran them locally with 10k iterations with no failures.