Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
3c6c424
Initial import for TDigest forking.
kkrik-es May 9, 2023
d719767
Fix MedianTest.
kkrik-es May 10, 2023
e816b57
Fix Dist.
kkrik-es May 11, 2023
0079943
Fix AVLTreeDigest.quantile to match Dist for uniform centroids.
kkrik-es May 11, 2023
0a18e70
Update docs/changelog/96086.yaml
kkrik-es May 15, 2023
96ea462
Fix `MergingDigest.quantile` to match `Dist` on uniform distribution.
kkrik-es May 12, 2023
56350ee
Add merging to TDigestState.hashCode and .equals.
kkrik-es May 16, 2023
d731aee
Fix style violations for tdigest library.
kkrik-es May 16, 2023
18c1cd5
Fix typo.
kkrik-es May 16, 2023
f96b4d2
Fix more style violations.
kkrik-es May 16, 2023
6d0201b
Fix more style violations.
kkrik-es May 16, 2023
9d48856
Fix remaining style violations in tdigest library.
kkrik-es May 16, 2023
68e489f
Update results in docs based on the forked tdigest.
kkrik-es May 17, 2023
2b3b463
Fix YAML tests in aggs module.
kkrik-es May 18, 2023
0d6ea1e
Fix YAML tests in x-pack/plugin.
kkrik-es May 18, 2023
98c1146
Skip failing V7 compat tests in modules/aggregations.
kkrik-es May 18, 2023
d49ed67
Fix TDigest library unittests.
kkrik-es May 22, 2023
13f17e6
Remove YAML test versions for older releases.
kkrik-es May 22, 2023
5d9ae8e
Fix test failures in docs and mixed cluster.
kkrik-es May 22, 2023
1ad14f8
Reduce buffer sizes in MergingDigest to avoid oom.
kkrik-es May 22, 2023
af93c26
Exclude more failing V7 compatibility tests.
kkrik-es May 23, 2023
d82ec3e
Update results for JdbcCsvSpecIT tests.
kkrik-es May 23, 2023
c9ab354
Update results for JdbcDocCsvSpecIT tests.
kkrik-es May 23, 2023
c19de44
Revert unrelated change.
kkrik-es May 23, 2023
9753468
More test fixes.
kkrik-es May 23, 2023
a23ae32
Use version skips instead of blacklisting in mixed cluster tests.
kkrik-es May 23, 2023
054cd90
Switch TDigestState back to AVLTreeDigest.
kkrik-es May 23, 2023
2ccefde
Update docs and tests with AVLTreeDigest output.
kkrik-es May 23, 2023
3801358
Update flaky test.
kkrik-es May 23, 2023
52ae1ff
Remove dead code, esp around tracking of incoming data.
kkrik-es May 24, 2023
6c05469
Update docs/changelog/96086.yaml
kkrik-es May 24, 2023
082ac3c
Delete docs/changelog/96086.yaml
kkrik-es May 24, 2023
5352c96
Remove explicit compression calls.
kkrik-es May 24, 2023
90b21bc
Merge remote-tracking branch 'upstream/fix/95903' into fix/95903
kkrik-es May 24, 2023
0003908
Revert "Remove explicit compression calls."
kkrik-es May 24, 2023
91fd594
Remove explicit compression calls to MedianAbsoluteDeviation input.
kkrik-es May 24, 2023
4ff173a
Add unittests for AVL and merging digest accuracy.
kkrik-es May 25, 2023
281bfc7
Fix spotless violations.
kkrik-es May 25, 2023
e382efa
Delete redundant tests and benchmarks.
kkrik-es May 29, 2023
60ec86f
Fix spotless violation.
kkrik-es May 29, 2023
fc512a7
Use the old implementation of AVLTreeDigest.
kkrik-es May 29, 2023
8bd54c8
Merge branch 'main' into fix/95903
kkrik-es May 29, 2023
e53bcc8
Update docs with latest percentile results.
kkrik-es May 29, 2023
6b29dc7
Update docs with latest percentile results.
kkrik-es May 29, 2023
b66664c
Merge branch 'main' into fix/95903
kkrik-es May 29, 2023
fe3facd
Remove repeated compression calls.
kkrik-es May 29, 2023
7389bdc
Update more percentile results.
kkrik-es May 29, 2023
0ff89ae
Use approximate percentile values in integration tests.
kkrik-es May 30, 2023
497202b
Fix expected percentile value in test.
kkrik-es May 30, 2023
093abb7
Revert in-place node updates in AVL tree.
kkrik-es Jun 1, 2023
b0c7870
Add SortingDigest and HybridDigest.
kkrik-es Jun 2, 2023
40f1861
Remove deps to the 3.2 library.
kkrik-es Jun 2, 2023
248560d
Remove unused licenses for tdigest.
kkrik-es Jun 2, 2023
2336b11
Revert changes for SortingDigest and HybridDigest.
kkrik-es Jun 6, 2023
ec87dea
Remove unused Histogram classes and unit tests.
kkrik-es Jun 6, 2023
5e06d79
Remove Comparison class, not used.
kkrik-es Jun 6, 2023
3e12dd4
Merge branch 'main' into fix/95903
kkrik-es Jun 6, 2023
7bfb729
Revert "Revert changes for SortingDigest and HybridDigest."
kkrik-es Jun 6, 2023
0842b27
Use HybridDigest as default tdigest implementation
kkrik-es Jun 8, 2023
063ef27
Small fixes.
kkrik-es Jun 8, 2023
c028d9c
Merge branch 'main' into fix/95903
kkrik-es Jun 8, 2023
cb171ab
Add javadoc and tests.
kkrik-es Jun 8, 2023
dc739af
Add javadoc and tests.
kkrik-es Jun 9, 2023
17b03cf
Remove special logic for singletons in the boundaries.
kkrik-es Jun 10, 2023
079a8c3
Revert changes to expected values in tests.
kkrik-es Jun 10, 2023
47414c7
Revert changes to expected values in tests.
kkrik-es Jun 10, 2023
b8f7c00
Merge branch 'main' into fix/95903
kkrik-es Jun 10, 2023
7718dbb
Tentatively restore percentile rank expected results.
kkrik-es Jun 10, 2023
4df40da
Use cdf version from 3.2
kkrik-es Jun 12, 2023
77c13eb
Revert "Tentatively restore percentile rank expected results."
kkrik-es Jun 12, 2023
4724905
Revert remaining changes compared to main.
kkrik-es Jun 12, 2023
64950c4
Revert excluded V7 compat tests.
kkrik-es Jun 12, 2023
7251150
Exclude V7 compat tests still failing.
kkrik-es Jun 12, 2023
4a78005
Exclude V7 compat tests still failing.
kkrik-es Jun 12, 2023
a847290
Remove ClusterSettings tentatively.
kkrik-es Jun 12, 2023
53f6c66
Initial import for TDigest forking.
kkrik-es May 9, 2023
317a4ff
Fix MedianTest.
kkrik-es May 10, 2023
a7b0b37
Fix Dist.
kkrik-es May 11, 2023
7b4ae66
Fix AVLTreeDigest.quantile to match Dist for uniform centroids.
kkrik-es May 11, 2023
f7321c1
Update docs/changelog/96086.yaml
kkrik-es May 15, 2023
1515ab1
Fix `MergingDigest.quantile` to match `Dist` on uniform distribution.
kkrik-es May 12, 2023
e1afb49
Add merging to TDigestState.hashCode and .equals.
kkrik-es May 16, 2023
e7ca078
Fix style violations for tdigest library.
kkrik-es May 16, 2023
0a8184f
Fix typo.
kkrik-es May 16, 2023
766dcb0
Fix more style violations.
kkrik-es May 16, 2023
6547bef
Fix more style violations.
kkrik-es May 16, 2023
d3b188d
Fix remaining style violations in tdigest library.
kkrik-es May 16, 2023
33d6049
Update results in docs based on the forked tdigest.
kkrik-es May 17, 2023
2dd1b18
Fix YAML tests in aggs module.
kkrik-es May 18, 2023
9da3c8d
Fix YAML tests in x-pack/plugin.
kkrik-es May 18, 2023
b0dbbff
Skip failing V7 compat tests in modules/aggregations.
kkrik-es May 18, 2023
e725a22
Fix TDigest library unittests.
kkrik-es May 22, 2023
4a02706
Remove YAML test versions for older releases.
kkrik-es May 22, 2023
8edf49e
Fix test failures in docs and mixed cluster.
kkrik-es May 22, 2023
2944856
Reduce buffer sizes in MergingDigest to avoid oom.
kkrik-es May 22, 2023
e68f692
Exclude more failing V7 compatibility tests.
kkrik-es May 23, 2023
c2452e9
Update results for JdbcCsvSpecIT tests.
kkrik-es May 23, 2023
b6b0721
Update results for JdbcDocCsvSpecIT tests.
kkrik-es May 23, 2023
6a49a6b
Revert unrelated change.
kkrik-es May 23, 2023
989c3f2
More test fixes.
kkrik-es May 23, 2023
a61a48c
Use version skips instead of blacklisting in mixed cluster tests.
kkrik-es May 23, 2023
0175ff8
Switch TDigestState back to AVLTreeDigest.
kkrik-es May 23, 2023
6babd70
Update docs and tests with AVLTreeDigest output.
kkrik-es May 23, 2023
86cde3c
Update flaky test.
kkrik-es May 23, 2023
32c51ea
Remove dead code, esp around tracking of incoming data.
kkrik-es May 24, 2023
3904a3b
Remove explicit compression calls.
kkrik-es May 24, 2023
73872a5
Update docs/changelog/96086.yaml
kkrik-es May 24, 2023
37499e6
Delete docs/changelog/96086.yaml
kkrik-es May 24, 2023
5dda5bd
Revert "Remove explicit compression calls."
kkrik-es May 24, 2023
0520197
Remove explicit compression calls to MedianAbsoluteDeviation input.
kkrik-es May 24, 2023
d9a4ce5
Add unittests for AVL and merging digest accuracy.
kkrik-es May 25, 2023
cb6564f
Fix spotless violations.
kkrik-es May 25, 2023
3ce5ec2
Delete redundant tests and benchmarks.
kkrik-es May 29, 2023
afc812a
Fix spotless violation.
kkrik-es May 29, 2023
e17d30c
Use the old implementation of AVLTreeDigest.
kkrik-es May 29, 2023
8ce1ac4
Update docs with latest percentile results.
kkrik-es May 29, 2023
44f0eb3
Update docs with latest percentile results.
kkrik-es May 29, 2023
139eaf6
Remove repeated compression calls.
kkrik-es May 29, 2023
0f3e019
Update more percentile results.
kkrik-es May 29, 2023
9222e81
Use approximate percentile values in integration tests.
kkrik-es May 30, 2023
5b62172
Fix expected percentile value in test.
kkrik-es May 30, 2023
244c8c0
Revert in-place node updates in AVL tree.
kkrik-es Jun 1, 2023
75ed609
Add SortingDigest and HybridDigest.
kkrik-es Jun 2, 2023
3e99d90
Remove deps to the 3.2 library.
kkrik-es Jun 2, 2023
d23e0f2
Remove unused licenses for tdigest.
kkrik-es Jun 2, 2023
0e41355
Revert changes for SortingDigest and HybridDigest.
kkrik-es Jun 6, 2023
6930a45
Remove unused Histogram classes and unit tests.
kkrik-es Jun 6, 2023
bb6f968
Remove Comparison class, not used.
kkrik-es Jun 6, 2023
b8e4c79
Revert "Revert changes for SortingDigest and HybridDigest."
kkrik-es Jun 6, 2023
bb2d7bb
Use HybridDigest as default tdigest implementation
kkrik-es Jun 8, 2023
23634d4
Add javadoc and tests.
kkrik-es Jun 8, 2023
c1c9f44
Remove ClusterSettings tentatively.
kkrik-es Jun 12, 2023
97ad6a9
Restore bySize function in TDigest and subclasses.
kkrik-es Jun 13, 2023
b13fccb
Merge branch 'main' into fix/95903
kkrik-es Jun 13, 2023
0831fbc
Merge branch 'fix/95903' into fix/95903-merging
kkrik-es Jun 13, 2023
46460fa
Merge remote-tracking branch 'upstream/fix/95903-merging' into fix/95…
kkrik-es Jun 13, 2023
4735914
Update Dist.cdf to match the rest.
kkrik-es Jun 13, 2023
e902ca3
Merge branch 'main' into fix/95903
kkrik-es Jun 13, 2023
c5be977
Merge branch 'fix/95903-merging' into fix/95903
kkrik-es Jun 13, 2023
5b0f784
Revert outdated test changes.
kkrik-es Jun 13, 2023
a6fdc93
Revert outdated changes.
kkrik-es Jun 13, 2023
519b558
Small fixes.
kkrik-es Jun 13, 2023
3a6cdf2
Update docs/changelog/96794.yaml
kkrik-es Jun 13, 2023
5e89aab
Merge branch 'fix/95903' into fix/95903-merging
kkrik-es Jun 13, 2023
cd6e11a
TDigestState uses MergingDigest by default.
kkrik-es Jun 13, 2023
cca7b3c
Make HybridDigest the default implementation.
kkrik-es Jun 13, 2023
c7b80ac
Merge remote-tracking branch 'upstream/fix/95903' into fix/95903
kkrik-es Jun 13, 2023
e8e8043
Update boxplot documentation.
kkrik-es Jun 13, 2023
90476ca
Use HybridDigest for real.
kkrik-es Jun 13, 2023
f058ef6
Restore AVLTreeDigest as the default in TDigestState.
kkrik-es Jun 13, 2023
a359fbd
Use execution_hint in tdigest spec.
kkrik-es Jun 14, 2023
efaf6fd
Restore expected test values.
kkrik-es Jun 14, 2023
dc76a88
Fix Dist.cdf for empty digest.
kkrik-es Jun 14, 2023
7287c19
Bump up TransportVersion.
kkrik-es Jun 14, 2023
66255c1
More test updates.
kkrik-es Jun 14, 2023
c206032
Merge branch 'main' into fix/95903
kkrik-es Jun 14, 2023
e873fb8
Bump up TransportVersion for real.
kkrik-es Jun 14, 2023
fbdbd16
Restore V7 compat blacklisting.
kkrik-es Jun 14, 2023
2b38504
HybridDigest uses its final implementation during deserialization.
kkrik-es Jun 14, 2023
79c1372
Restore the right TransportVersion in TDigestState.read
kkrik-es Jun 14, 2023
f61f4ad
More test fixes.
kkrik-es Jun 14, 2023
8ec621a
Merge branch 'fix/95903' into fix/95903-merging
kkrik-es Jun 14, 2023
c0e783d
More test updates.
kkrik-es Jun 14, 2023
5c96899
Merge branch 'main' into fix/95903
kkrik-es Jun 15, 2023
de29750
Use TDigestExecutionHint instead of strings.
kkrik-es Jun 15, 2023
c728714
Add link to TDigest javadoc.
kkrik-es Jun 15, 2023
0956241
Spotless fix.
kkrik-es Jun 15, 2023
4da7b48
Merge branch 'main' into fix/95903
kkrik-es Jun 15, 2023
5edb2a3
Small fixes.
kkrik-es Jun 15, 2023
e429ac3
Merge branch 'fix/95903' into fix/95903-merging
kkrik-es Jun 15, 2023
425ce8a
Merge branch 'main' into fix/95903
kkrik-es Jun 15, 2023
fc11be2
Bump up TransportVersion.
kkrik-es Jun 15, 2023
88c080f
Merge branch 'main' into fix/95903
kkrik-es Jun 16, 2023
7929ea2
Bump up the TransportVersion, again.
kkrik-es Jun 16, 2023
ff825d2
Merge branch 'main' into fix/95903
kkrik-es Jun 18, 2023
59a0577
Merge branch 'main' into fix/95903
kkrik-es Jun 18, 2023
44c7d7f
Merge branch 'fix/95903-merging' into fix/95903
kkrik-es Jun 18, 2023
f977b54
Update docs/changelog/96904.yaml
kkrik-es Jun 18, 2023
833e09b
Delete 96794.yaml
kkrik-es Jun 18, 2023
e05dacc
Merge branch 'main' into fix/95903
kkrik-es Jun 18, 2023
50af988
Merge remote-tracking branch 'upstream/fix/95903' into fix/95903
kkrik-es Jun 18, 2023
a42c07b
Restore previous changelog.
kkrik-es Jun 18, 2023
86622b1
Rename 96794.yaml to 96794.yaml
kkrik-es Jun 18, 2023
f4b5650
Update breaking change notes in changelog.
kkrik-es Jun 18, 2023
4873e18
Merge remote-tracking branch 'upstream/fix/95903' into fix/95903
kkrik-es Jun 18, 2023
ba7f04f
Remove mapping value from changelog.
kkrik-es Jun 18, 2023
f8344f6
Set a valid breaking area.
kkrik-es Jun 18, 2023
87ec1e9
Use HybridDigest as default TDigest impl.
kkrik-es Jun 18, 2023
50c882f
Update docs/changelog/96904.yaml
kkrik-es Jun 19, 2023
7b96dde
Use TDigestExecutionHint in MedianAbsoluteDeviationAggregator.
kkrik-es Jun 19, 2023
74f3b04
Merge remote-tracking branch 'upstream/fix/95903' into fix/95903
kkrik-es Jun 19, 2023
c821932
Merge branch 'main' into fix/95903
kkrik-es Jun 19, 2023
1f3ec47
Update changelog and comment in blacklisted V7 compat tests.
kkrik-es Jun 19, 2023
d0bfc6c
Update breaking area in changelog.
kkrik-es Jun 19, 2023
46a285f
Merge branch 'main' into fix/95903
kkrik-es Jun 19, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/changelog/96904.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pr: 96904
summary: Switch TDigestState to use `HybridDigest` by default
area: Aggregations
type: breaking
issues: []
breaking:
title: Switch TDigestState to use `HybridDigest` by default
area: REST API
details: "The default implementation for TDigest in percentile calculations switches\
\ to a new internal implementation offering superior performance (2x-10x speedup),\
\ at a very small accuracy penalty for very large sample populations."
impact: "This change leads to generating slightly different results in percentile\
\ calculations. If the highest possible accuracy is desired, or it's crucial to\
\ produce exactly the same results as in previous versions, one can either set\
\ `execution_hint` to `high_accuracy` in the `tdigest` spec of a given percentile\
\ calculation, or set `search.aggs.tdigest_execution_hint` to `high_accuracy`\
\ in cluster settings to apply to all percentile queries."
notable: true
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ The response will look like this:
"load_time_boxplot": {
"min": 0.0,
"max": 990.0,
"q1": 165.0,
"q1": 167.5,
"q2": 445.0,
"q3": 725.0,
"q3": 722.5,
"lower": 0.0,
"upper": 990.0
}
Expand Down Expand Up @@ -114,9 +114,9 @@ GET latency/_search
"load_time_boxplot": {
"min": 0.0,
"max": 99.0,
"q1": 16.5,
"q1": 16.75,
"q2": 44.5,
"q3": 72.5,
"q3": 72.25,
"lower": 0.0,
"upper": 99.0
}
Expand Down
50 changes: 32 additions & 18 deletions docs/reference/aggregations/metrics/percentile-aggregation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,26 @@ percentiles: `[ 1, 5, 25, 50, 75, 95, 99 ]`. The response will look like this:
"aggregations": {
"load_time_outlier": {
"values": {
"1.0": 5.0,
"5.0": 25.0,
"25.0": 165.0,
"1.0": 10.0,
"5.0": 30.0,
"25.0": 170.0,
"50.0": 445.0,
"75.0": 725.0,
"95.0": 945.0,
"99.0": 985.0
"75.0": 720.0,
"95.0": 940.0,
"99.0": 980.0
}
}
}
}
--------------------------------------------------
// TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
// TESTRESPONSE[s/"1.0": 10.0/"1.0": 9.9/]
// TESTRESPONSE[s/"5.0": 30.0/"5.0": 29.5/]
// TESTRESPONSE[s/"25.0": 170.0/"25.0": 167.5/]
// TESTRESPONSE[s/"50.0": 445.0/"50.0": 445.0/]
// TESTRESPONSE[s/"75.0": 720.0/"75.0": 722.5/]
// TESTRESPONSE[s/"95.0": 940.0/"95.0": 940.5/]
// TESTRESPONSE[s/"99.0": 980.0/"99.0": 980.1/]

As you can see, the aggregation will return a calculated value for each percentile
in the default range. If we assume response times are in milliseconds, it is
Expand Down Expand Up @@ -128,38 +135,45 @@ Response:
"values": [
{
"key": 1.0,
"value": 5.0
"value": 10.0
},
{
"key": 5.0,
"value": 25.0
"value": 30.0
},
{
"key": 25.0,
"value": 165.0
"value": 170.0
},
{
"key": 50.0,
"value": 445.0
},
{
"key": 75.0,
"value": 725.0
"value": 720.0
},
{
"key": 95.0,
"value": 945.0
"value": 940.0
},
{
"key": 99.0,
"value": 985.0
"value": 980.0
}
]
}
}
}
--------------------------------------------------
// TESTRESPONSE[s/\.\.\./"took": $body.took,"timed_out": false,"_shards": $body._shards,"hits": $body.hits,/]
// TESTRESPONSE[s/"value": 10.0/"value": 9.9/]
// TESTRESPONSE[s/"value": 30.0/"value": 29.5/]
// TESTRESPONSE[s/"value": 170.0/"value": 167.5/]
// TESTRESPONSE[s/"value": 445.0/"value": 445.0/]
// TESTRESPONSE[s/"value": 720.0/"value": 722.5/]
// TESTRESPONSE[s/"value": 940.0/"value": 940.5/]
// TESTRESPONSE[s/"value": 980.0/"value": 980.1/]

==== Script

Expand Down Expand Up @@ -203,13 +217,13 @@ GET latency/_search
"aggregations": {
"load_time_outlier": {
"values": {
"1.0": 0.5,
"5.0": 2.5,
"25.0": 16.5,
"1.0": 0.99,
"5.0": 2.95,
"25.0": 16.75,
"50.0": 44.5,
"75.0": 72.5,
"95.0": 94.5,
"99.0": 98.5
"75.0": 72.25,
"95.0": 94.05,
"99.0": 98.01
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ And the following may be the response:
"doc_count": 3,
"the_percentile": {
"values": {
"1.0": 150.0,
"1.0": 151.0,
"99.0": 200.0
}
}
Expand All @@ -108,13 +108,13 @@ And the following may be the response:
"doc_count": 2,
"the_percentile": {
"values": {
"1.0": 10.0,
"99.0": 50.0
"1.0": 10.4,
"99.0": 49.6
}
},
"the_movperc": {
"values": {
"1.0": 150.0,
"1.0": 151.0,
"99.0": 200.0
}
}
Expand All @@ -125,13 +125,13 @@ And the following may be the response:
"doc_count": 2,
"the_percentile": {
"values": {
"1.0": 175.0,
"99.0": 200.0
"1.0": 175.25,
"99.0": 199.75
}
},
"the_movperc": {
"values": {
"1.0": 10.0,
"1.0": 11.6,
"99.0": 200.0
}
}
Expand Down
12 changes: 11 additions & 1 deletion modules/aggregations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,17 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task ->
task.skipTest("search.aggregation/20_terms/numeric profiler", "The profiler results aren't backwards compatible.")
task.skipTest("search.aggregation/210_top_hits_nested_metric/top_hits aggregation with sequence numbers", "#42809 the use nested path and filter sort throws an exception")
task.skipTest("search.aggregation/370_doc_count_field/Test filters agg with doc_count", "Uses profiler for assertions which is not backwards compatible")
task.skipTest("search.aggregation/420_percentile_ranks_tdigest_metric/filtered", "Uses t-digest library which is not backwards compatible")

// In 8.9.0, the default t-digest algorithm changed from AVL-tree-based to hybrid, combining a sorted array of samples with a merging
// implementation. This change leads to slight different percentile results, compared to previous versions.
task.skipTest("search.aggregation/180_percentiles_tdigest_metric/Basic test", "Hybrid t-digest produces different results.")
task.skipTest("search.aggregation/180_percentiles_tdigest_metric/Non-keyed test", "Hybrid t-digest produces different results.")
task.skipTest("search.aggregation/180_percentiles_tdigest_metric/Only aggs test", "Hybrid t-digest produces different results.")
task.skipTest("search.aggregation/180_percentiles_tdigest_metric/Explicit Percents test", "Hybrid t-digest produces different results.")
task.skipTest("search.aggregation/180_percentiles_tdigest_metric/Metadata test", "Hybrid t-digest produces different results.")
task.skipTest("search.aggregation/180_percentiles_tdigest_metric/Filtered test", "Hybrid t-digest produces different results.")
task.skipTest("search.aggregation/420_percentile_ranks_tdigest_metric/filtered", "Hybrid t-digest produces different results.")

task.addAllowedWarningRegex("\\[types removal\\].*")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ setup:

---
"Basic test":
- skip:
version: " - 8.8.99"
reason: t-digest forked in 8.9.0
- do:
search:
rest_total_hits_as_int: true
Expand All @@ -61,21 +64,21 @@ setup:
- match: { hits.total: 4 }
- length: { hits.hits: 4 }

- match: { aggregations.percentiles_int.values.1\.0: 1.0 }
- match: { aggregations.percentiles_int.values.5\.0: 1.0 }
- match: { aggregations.percentiles_int.values.25\.0: 26.0 }
- match: { aggregations.percentiles_int.values.1\.0: 2.5 }
- match: { aggregations.percentiles_int.values.5\.0: 8.5 }
- match: { aggregations.percentiles_int.values.25\.0: 38.5 }
- match: { aggregations.percentiles_int.values.50\.0: 76.0 }
- match: { aggregations.percentiles_int.values.75\.0: 126.0 }
- match: { aggregations.percentiles_int.values.95\.0: 151.0 }
- match: { aggregations.percentiles_int.values.99\.0: 151.0 }
- match: { aggregations.percentiles_int.values.75\.0: 113.5 }
- match: { aggregations.percentiles_int.values.95\.0: 143.5 }
- match: { aggregations.percentiles_int.values.99\.0: 149.5 }

- match: { aggregations.percentiles_double.values.1\.0: 1.0 }
- match: { aggregations.percentiles_double.values.5\.0: 1.0 }
- match: { aggregations.percentiles_double.values.25\.0: 26.0 }
- match: { aggregations.percentiles_double.values.1\.0: 2.5 }
- match: { aggregations.percentiles_double.values.5\.0: 8.5 }
- match: { aggregations.percentiles_double.values.25\.0: 38.5 }
- match: { aggregations.percentiles_double.values.50\.0: 76.0 }
- match: { aggregations.percentiles_double.values.75\.0: 126.0 }
- match: { aggregations.percentiles_double.values.95\.0: 151.0 }
- match: { aggregations.percentiles_double.values.99\.0: 151.0 }
- match: { aggregations.percentiles_double.values.75\.0: 113.5 }
- match: { aggregations.percentiles_double.values.95\.0: 143.5 }
- match: { aggregations.percentiles_double.values.99\.0: 149.5 }

- do:
search:
Expand All @@ -97,21 +100,21 @@ setup:
- match: { hits.total: 4 }
- length: { hits.hits: 4 }

- match: { aggregations.percentiles_int.values.1\.0: 1.0 }
- match: { aggregations.percentiles_int.values.5\.0: 1.0 }
- match: { aggregations.percentiles_int.values.25\.0: 26.0 }
- match: { aggregations.percentiles_int.values.1\.0: 2.5 }
- match: { aggregations.percentiles_int.values.5\.0: 8.5 }
- match: { aggregations.percentiles_int.values.25\.0: 38.5 }
- match: { aggregations.percentiles_int.values.50\.0: 76.0 }
- match: { aggregations.percentiles_int.values.75\.0: 126.0 }
- match: { aggregations.percentiles_int.values.95\.0: 151.0 }
- match: { aggregations.percentiles_int.values.99\.0: 151.0 }
- match: { aggregations.percentiles_int.values.75\.0: 113.5 }
- match: { aggregations.percentiles_int.values.95\.0: 143.5 }
- match: { aggregations.percentiles_int.values.99\.0: 149.5 }

- match: { aggregations.percentiles_double.values.1\.0: 1.0 }
- match: { aggregations.percentiles_double.values.5\.0: 1.0 }
- match: { aggregations.percentiles_double.values.25\.0: 26.0 }
- match: { aggregations.percentiles_double.values.1\.0: 2.5 }
- match: { aggregations.percentiles_double.values.5\.0: 8.5 }
- match: { aggregations.percentiles_double.values.25\.0: 38.5 }
- match: { aggregations.percentiles_double.values.50\.0: 76.0 }
- match: { aggregations.percentiles_double.values.75\.0: 126.0 }
- match: { aggregations.percentiles_double.values.95\.0: 151.0 }
- match: { aggregations.percentiles_double.values.99\.0: 151.0 }
- match: { aggregations.percentiles_double.values.75\.0: 113.5 }
- match: { aggregations.percentiles_double.values.95\.0: 143.5 }
- match: { aggregations.percentiles_double.values.99\.0: 149.5 }


---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void collect(int doc, long bucket) throws IOException {

TDigestState valueSketch = valueSketches.get(bucket);
if (valueSketch == null) {
valueSketch = TDigestState.create(compression);
valueSketch = TDigestState.create(compression, executionHint);
valueSketches.set(bucket, valueSketch);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected enum Type {
SORTING;

static Type defaultValue() {
return AVL_TREE;
return HYBRID;
Copy link
Member

Choose a reason for hiding this comment

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

🚀

}

static Type valueForHighAccuracy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public void testSomeMatchesSortedNumericDocValues() throws IOException {
}, tdigest -> {
assertEquals(7L, tdigest.state.size());
assertEquals(7L, tdigest.state.centroidCount());
assertEquals(4.5d, tdigest.percentile(75), 0.0d);
assertEquals("4.5", tdigest.percentileAsString(75));
assertEquals(4.0d, tdigest.percentile(75), 0.0d);
assertEquals("4.0", tdigest.percentileAsString(75));
assertEquals(2.0d, tdigest.percentile(50), 0.0d);
assertEquals("2.0", tdigest.percentileAsString(50));
assertEquals(1.0d, tdigest.percentile(22), 0.0d);
Expand All @@ -107,14 +107,14 @@ public void testSomeMatchesNumericDocValues() throws IOException {
assertEquals(tdigest.state.centroidCount(), 7L);
assertEquals(8.0d, tdigest.percentile(100), 0.0d);
assertEquals("8.0", tdigest.percentileAsString(100));
assertEquals(6.98d, tdigest.percentile(88), 0.0d);
assertEquals("6.98", tdigest.percentileAsString(88));
assertEquals(4.0d, tdigest.percentile(75), 0.0d);
assertEquals("4.0", tdigest.percentileAsString(75));
assertEquals(1.0d, tdigest.percentile(33), 0.0d);
assertEquals("1.0", tdigest.percentileAsString(33));
assertEquals(1.0d, tdigest.percentile(25), 0.0d);
assertEquals("1.0", tdigest.percentileAsString(25));
assertEquals(0.0d, tdigest.percentile(1), 0.0d);
assertEquals("0.0", tdigest.percentileAsString(1));
assertEquals(0.06d, tdigest.percentile(1), 0.0d);
assertEquals("0.06", tdigest.percentileAsString(1));
assertTrue(AggregationInspectionHelper.hasValue(tdigest));
});
}
Expand All @@ -135,7 +135,7 @@ public void testQueryFiltering() throws IOException {
assertEquals(4L, tdigest.state.centroidCount());
assertEquals(2.0d, tdigest.percentile(100), 0.0d);
assertEquals(1.0d, tdigest.percentile(50), 0.0d);
assertEquals(0.5d, tdigest.percentile(25), 0.0d);
assertEquals(0.75d, tdigest.percentile(25), 0.0d);
assertTrue(AggregationInspectionHelper.hasValue(tdigest));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public void testFactoryMethods() {

assertEquals(fast, anotherFast);
assertEquals(accurate, anotherAccurate);
assertNotEquals(fast, accurate);
assertNotEquals(anotherFast, anotherAccurate);
}

private static TDigestState writeToAndReadFrom(TDigestState state, TransportVersion version) throws IOException {
Expand Down Expand Up @@ -195,6 +197,7 @@ public void testSerialization() throws IOException {
assertEquals(serialized, state);

TDigestState serializedBackwardsCompatible = writeToAndReadFrom(state, TransportVersion.V_8_500_000);
assertNotEquals(serializedBackwardsCompatible, state);
assertEquals(serializedBackwardsCompatible, backwardsCompatible);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ public void testSomeMatchesBinaryDocValues() throws IOException {
}, hdr -> {
// assertEquals(4L, hdr.state.getTotalCount());
double approximation = 0.05d;
assertEquals(15.0d, hdr.percentile(25), approximation);
assertEquals(17.5d, hdr.percentile(25), approximation);
assertEquals(30.0d, hdr.percentile(50), approximation);
assertEquals(50.0d, hdr.percentile(75), approximation);
assertEquals(60.0d, hdr.percentile(99), approximation);
assertEquals(45.0d, hdr.percentile(75), approximation);
assertEquals(59.4d, hdr.percentile(99), approximation);
assertTrue(AggregationInspectionHelper.hasValue(hdr));
});
}
Expand All @@ -105,9 +105,9 @@ public void testSomeMatchesMultiBinaryDocValues() throws IOException {
}, hdr -> {
// assertEquals(16L, hdr.state.getTotalCount());
double approximation = 0.05d;
assertEquals(15.0d, hdr.percentile(25), approximation);
assertEquals(17.5d, hdr.percentile(25), approximation);
assertEquals(30.0d, hdr.percentile(50), approximation);
assertEquals(50.0d, hdr.percentile(75), approximation);
assertEquals(45.0d, hdr.percentile(75), approximation);
assertEquals(60.0d, hdr.percentile(99), approximation);
assertTrue(AggregationInspectionHelper.hasValue(hdr));
});
Expand Down
Loading