Age | Commit message (Collapse) | Author |
|
(#25219)
This change adds tests for the aggregation parsing that try to simulate that we
can parse existing aggregations in a forward compatible way in the future,
ignoring potential newly added fields or substructures to the xContent response.
|
|
|
|
This moves the releasing logic to the base test, so that individual test cases don't need
to worry about releasing the aggregators. It's not a big deal for individual aggs,
but once tests start using sub-aggs, it can become tricky to free (without double-freeing)
all the aggregators.
|
|
|
|
# Conflicts:
# core/src/test/java/org/elasticsearch/search/aggregations/bucket/terms/InternalTermsTestCase.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalExtendedStatsTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalMaxTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalStatsTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/avg/InternalAvgTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/cardinality/InternalCardinalityTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/geobounds/InternalGeoBoundsTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/geocentroid/InternalGeoCentroidTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/min/InternalMinTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/percentiles/InternalPercentilesTestCase.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/percentiles/hdr/InternalHDRPercentilesRanksTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/percentiles/tdigest/InternalTDigestPercentilesRanksTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/sum/InternalSumTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/valuecount/InternalValueCountTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/pipeline/InternalSimpleValueTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/pipeline/bucketmetrics/percentile/InternalPercentilesBucketTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/pipeline/derivative/InternalDerivativeTests.java
# test/framework/src/main/java/org/elasticsearch/test/InternalAggregationTestCase.java
|
|
Also moved InternalAggregationTestCase to test-framework module in order to make use of it from other modules than core.
Relates to #22278
|
|
AggregationsTests#testFromXContent verifies that parsing of aggregations works by combining multiple aggs at the same level, and also adding sub-aggregations to multi bucket and single bucket aggs, up to a maximum depth of 5.
|
|
|
|
Relates to #22278
|
|
|
|
|
|
Currently InternalPercentilesBucket#percentile() relies on the percent array passed in
to be in sorted order. This changes the aggregation to store an internal lookup table that
is constructed from the percent/percentiles arrays passed in that can be used to look up
the percentile values.
Closes #24331
|
|
|
|
# Conflicts:
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/percentiles/InternalPercentilesTestCase.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/percentiles/hdr/InternalHDRPercentilesTests.java
|
|
In InternalAggregationTestCase, we can check that the internal aggregation and the parsed aggregation always produce the same XContent even if the original internal aggregation has been shuffled or not.
|
|
|
|
|
|
|
|
# Conflicts:
# core/src/main/java/org/elasticsearch/search/DocValueFormat.java
# core/src/test/java/org/elasticsearch/search/aggregations/InternalAggregationTestCase.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/InternalMaxTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/avg/InternalAvgTests.java
# core/src/test/java/org/elasticsearch/search/aggregations/metrics/min/InternalMinTests.java
|
|
Related to #22278
|
|
Now the Percentile interface has been merged with the InternalPercentile
class in core (#24154) the AbstractParsedPercentiles should use it.
This commit also changes InternalPercentilesRanksTestCase so that it now
tests the iterator obtained from parsed percentiles ranks aggregations.
Adding this new test raised an issue in the iterators where key and
value are "swapped" in internal implementations when building the
iterators (see InternalTDigestPercentileRanks.Iter constructor that
accepts the `keys` as the first parameter named `values`, each key
being mapped to the `value` field of Percentile class). This is because
percentiles ranks aggs inverts percentiles/values compared to the
percentiles aggs.
* Add assume in InternalAggregationTestCase
* Update after Luca review
|
|
|
|
This commit adds the logic for parsing the percentiles ranks aggregations.
|
|
|
|
Relates #22278
|
|
BytesReference should be a really simple interface, yet it has a gazillion
ways to achieve the same this. Methods like `#hasArray`, `#toBytesArray`, `#copyBytesArray`
`#toBytesRef` `#bytes` are all really duplicates. This change simplifies the interface
dramatically and makes implementations of it much simpler. All array access has been removed
and is streamlined through a single `#toBytesRef` method. Utility methods to materialize a
compact byte array has been added too for convenience.
|
|
Replace with a constructor that takes StreamInput or a static method.
In one case (ValuesSourceType) we no longer need to serialize the data
at all!
Relates to #17085
|
|
|