-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Making changes in InternalValueCount and InternalAvg to support Scripted metric in reducing aggregation #18411
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
Making changes in InternalValueCount and InternalAvg to support Scripted metric in reducing aggregation #18411
Conversation
|
❌ Gradle check result for 1397185: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
sandeshkr419
left a comment
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 saw the comment on https://github.com/opensearch-project/index-management/blame/main/src/main/kotlin/org/opensearch/indexmanagement/rollup/util/RollupUtils.kt#L263
How early was it tested that the value count aggregation does not fulfil what you need?
I see some comments on type conversions, which I guess should be doable for value counts given that value counts will be a whole number for sure (I guess).
Now I don't fully understand your use-case in IM, but is it feasible to sum & value-count from core as it is and then calculate sum/value-count in IM plugin? Also, please check my comment in InternalAvg.java as well.
server/src/main/java/org/opensearch/search/aggregations/metrics/InternalAvg.java
Outdated
Show resolved
Hide resolved
001f7e8 to
e3811a7
Compare
…ted metric in reducing agggregation Signed-off-by: Kshitij Tandon <[email protected]>
…e and value count aggregations Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
e3811a7 to
d748ab9
Compare
Signed-off-by: Kshitij Tandon <[email protected]>
d748ab9 to
41bd4e5
Compare
|
❌ Gradle check result for 41bd4e5: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Kshitij Tandon <[email protected]>
|
❌ Gradle check result for 9eaeccb: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Kshitij Tandon <[email protected]>
Signed-off-by: Kshitij Tandon <[email protected]>
|
❌ Gradle check result for c1b4da4: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
c1b4da4 to
594c2c3
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #18411 +/- ##
============================================
+ Coverage 72.87% 72.92% +0.05%
- Complexity 69326 69362 +36
============================================
Files 5641 5642 +1
Lines 318474 318504 +30
Branches 46062 46068 +6
============================================
+ Hits 232076 232276 +200
+ Misses 67581 67438 -143
+ Partials 18817 18790 -27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Kshitij Tandon <[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.
@tandonks Since the changes have already been merged, can you please fix the license header in a new PR?
Thanks!
| /* | ||
| * Licensed to Elasticsearch under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| /* | ||
| * Modifications Copyright OpenSearch Contributors. See | ||
| * GitHub history for details. | ||
| */ | ||
|
|
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.
Since this is a new file, can you please fix the license header - you only need lines 1-7 as license header and not the remaining Elasticsearch license lines 9-31.
…ted metric in reducing aggregation (opensearch-project#18411) * Making changes in InternalValueCount and InternalAvg to support Scripted metric in reducing agggregation Signed-off-by: Kshitij Tandon <[email protected]> * Adding tests for supporting Scripted Aggregation in reduce for average and value count aggregations Signed-off-by: Kshitij Tandon <[email protected]> * Fixing build issues Signed-off-by: Kshitij Tandon <[email protected]> * Addressed comments around logging and tests Signed-off-by: Kshitij Tandon <[email protected]> * Making changes to CHANGELOG.md Signed-off-by: Kshitij Tandon <[email protected]> * Adding a new class ScriptedAvg for reduce Signed-off-by: Kshitij Tandon <[email protected]> * Adding changes to CHANGELOG Signed-off-by: Kshitij Tandon <[email protected]> * Adding javadocs Signed-off-by: Kshitij Tandon <[email protected]> * Fixing violations Signed-off-by: Kshitij Tandon <[email protected]> --------- Signed-off-by: Kshitij Tandon <[email protected]>
Description
We had introduced the support for searching rollup and raw indices together in this opensearch-project/index-management#1268 but there was a bug in this due to class cast exception error when trying to reduce InternalValueCount and InternalAggregation as both used InternalScriptedMetric in their aggregation builder here. So this PR fixes this issue by introducing support for InternalScriptedMetric when trying to reduce these aggregations. Also included tests to cover these changes
Related PR: #18288
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
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.