Support "_first" and "_last" ordering of missing values in composite aggs#76740
Conversation
b937542 to
1d77b12
Compare
1d77b12 to
cfc69a6
Compare
827f69f to
e7db340
Compare
a13c500 to
53eecca
Compare
53eecca to
29d8b48
Compare
29d8b48 to
3eabe92
Compare
|
Pinging @elastic/es-analytics-geo (Team:Analytics) |
nik9000
left a comment
There was a problem hiding this comment.
I think it's right though I'd do the BWC/backport differently.
@ywelsch and @not-napoleon have both recently looked more closely at this code than I have and might want to have a look too.
| this.userValueTypeHint = ValueType.readFromStream(in); | ||
| } | ||
| this.missingBucket = in.readBoolean(); | ||
| if (in.getVersion().onOrAfter(Version.V_7_16_0)) { |
There was a problem hiding this comment.
I tend to set this to 8_0_0 when I introduce these changes so that CI runs the bwc tests before I merge. I'll prepare the backport PR and a separate PR to disable bwc. Once both pass i merged the disabling first, wait a bit, and merge the backport. Then merge a final thing to master to undo it. It's a bunch of work but it keeps the BWC tests running as long as possible.
There was a problem hiding this comment.
👍 The fact that all the bwc tests passed despite that I've been using 7.16 here also made me think that maybe I'm missing some tests. So I added some more rest tests and adjusted the versions.
💔 Backport failed
You can use sqren/backport to manually backport by running |
…aggs (elastic#76740) * Support "first" and "last" ordering of missing values in composite aggs * skip API compat tests for 7.16 * use proper versions for bwc * use "missing_order" parameter instead of "missing" * address review comments # Conflicts: # server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java
…osite aggs (#76740) (#77620) * Support "_first" and "_last" ordering of missing values in composite aggs (#76740) * Support "first" and "last" ordering of missing values in composite aggs * skip API compat tests for 7.16 * use proper versions for bwc * use "missing_order" parameter instead of "missing" * address review comments # Conflicts: # server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java * adjust versions for BWC
Follow up of #77650. Looks like two issues caused occasional failures: missingOrder has not been considered in InternalComposite.InternalBucket#compareKey reverseMul has been ignored in one case in OrdinalValuesSource#compareInternal The first problem has clearly been introduced by #76740 but the second point is more interesting. As far as I understand, this might have caused problems before but I couldn't find any according test failures in Gradle before yesterday. In order to preclude further rare test failures I've run the whole CompositeAggregatorTests 3000 times and all tests turned green.
…77691) Follow up of elastic#77650. Looks like two issues caused occasional failures: missingOrder has not been considered in InternalComposite.InternalBucket#compareKey reverseMul has been ignored in one case in OrdinalValuesSource#compareInternal The first problem has clearly been introduced by elastic#76740 but the second point is more interesting. As far as I understand, this might have caused problems before but I couldn't find any according test failures in Gradle before yesterday. In order to preclude further rare test failures I've run the whole CompositeAggregatorTests 3000 times and all tests turned green. # Conflicts: # server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/InternalComposite.java
Follow up of #77650. Looks like two issues caused occasional failures: missingOrder has not been considered in InternalComposite.InternalBucket#compareKey reverseMul has been ignored in one case in OrdinalValuesSource#compareInternal The first problem has clearly been introduced by #76740 but the second point is more interesting. As far as I understand, this might have caused problems before but I couldn't find any according test failures in Gradle before yesterday. In order to preclude further rare test failures I've run the whole CompositeAggregatorTests 3000 times and all tests turned green. # Conflicts: # server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/InternalComposite.java
|
Closes #34221 |
Documents the missing_order parameter for composite aggregations introduced in #76740
Documents the missing_order parameter for composite aggregations introduced in elastic#76740
Resolves #63523 and #34550
Extends the composite value source builders with a new
missing_orderparameter that additionally allows to always put missing buckets "first" or "last" independently of the sort order.Example query:
If
missing_bucketisfalseor missing, themissing_orderparameter will be ignored.