Support _first and _last parameter for missing bucket ordering in composite aggregation#1942
Conversation
By default, if order is asc, missing_bucket at first, if order is desc, missing_bucket at last. If missing_order is "_first" or "_last", regardless order, missing_bucket is at first or last respectively. Signed-off-by: Peng Huo <penghuo@gmail.com>
|
Can one of the admins verify this patch? |
Signed-off-by: Peng Huo <penghuo@gmail.com>
| if (in.getVersion().onOrAfter(Version.V_2_0_0)) { | ||
| this.missingOrder = MissingOrder.readFromStream(in); | ||
| } |
There was a problem hiding this comment.
Do you plan to leave this feature only for 2.0.0?
I dont see any harm to include this for 1.3.0.
There was a problem hiding this comment.
1.3.0 also works, there is no blocker.
totally agree, doc is necessary. i add javadoc on setter method. any suggestion for others?
There was a problem hiding this comment.
If you'd like this for 1.3.0 (I'm good w/ that) let's make the version change in a separate backportable PR.
There was a problem hiding this comment.
I prefer a separate backportable PR for 1.3.0.
nknize
left a comment
There was a problem hiding this comment.
Overall LGTM! Just a few nit picky changes.
...er/src/main/java/org/opensearch/search/aggregations/bucket/composite/BinaryValuesSource.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/org/opensearch/search/aggregations/bucket/composite/BinaryValuesSource.java
Outdated
Show resolved
Hide resolved
...er/src/main/java/org/opensearch/search/aggregations/bucket/composite/BinaryValuesSource.java
Outdated
Show resolved
Hide resolved
| if (in.getVersion().onOrAfter(Version.V_2_0_0)) { | ||
| this.missingOrder = MissingOrder.readFromStream(in); | ||
| } |
There was a problem hiding this comment.
If you'd like this for 1.3.0 (I'm good w/ that) let's make the version change in a separate backportable PR.
...n/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java
Outdated
Show resolved
Hide resolved
...main/java/org/opensearch/search/aggregations/bucket/composite/GlobalOrdinalValuesSource.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/aggregations/bucket/composite/LongValuesSource.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/aggregations/bucket/composite/LongValuesSource.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/aggregations/bucket/composite/LongValuesSource.java
Outdated
Show resolved
Hide resolved
.../test/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregatorTests.java
Show resolved
Hide resolved
Signed-off-by: Peng Huo <penghuo@gmail.com>
|
@nknize Thanks for the feedback, good point. I pushed a fix and resolve comments which I already addressed, but I am leaving 1 comment unresolved and want to double confirm with you. |
I'm good w/ that! |
nknize
left a comment
There was a problem hiding this comment.
LGTM! Thx for the quick turnaround!
…r parameter (opensearch-project#1942) InternalBucket should use MissingOrder to decide null values's order. Signed-off-by: Peng Huo <penghuo@gmail.com>
…site aggregation (opensearch-project#1942) Support for "first" and "last" parameters for missing bucket ordering in composite aggregation. By default, if order is asc, missing_bucket at first, if order is desc, missing_bucket at last. If missing_order is "first" or "last", regardless order, missing_bucket is at first or last respectively. Signed-off-by: Peng Huo <penghuo@gmail.com>
…site aggregation (#1942) (#2049) Support for "first" and "last" parameters for missing bucket ordering in composite aggregation. By default, if order is asc, missing_bucket at first, if order is desc, missing_bucket at last. If missing_order is "first" or "last", regardless order, missing_bucket is at first or last respectively. Signed-off-by: Peng Huo <penghuo@gmail.com>
…in composite aggregation (opensearch-project#1942) (opensearch-project#2049)" This reverts commit 5b27136. Signed-off-by: Andrew Ross <andrross@amazon.com>
Description
Support _first and _last parameter for missing bucket ordering in composite aggregation.
If missing_order is "_first" or "_last", regardless order, missing_bucket is at first or last respectively. for example, the following query will sort
productasc and null bucket will be placed at last.Issues Resolved
#1899
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.