-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
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 <[email protected]>
Can one of the admins verify this patch? |
Signed-off-by: Peng Huo <[email protected]>
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.
if (in.getVersion().onOrAfter(Version.V_2_0_0)) { | ||
this.missingOrder = MissingOrder.readFromStream(in); | ||
} |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer a separate backportable PR for 1.3.0.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
@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! |
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.
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 <[email protected]>
…r parameter (#1942) (#2005) Fix composite aggregation failed test cases introduce by missing_order parameter by using MissingOrder to decide null values's order in InternalBucket. Signed-off-by: Peng Huo <[email protected]>
…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 <[email protected]>
…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 <[email protected]>
…in composite aggregation (opensearch-project#1942) (opensearch-project#2049)" This reverts commit 5b27136. Signed-off-by: Andrew Ross <[email protected]>
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
product
asc 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.