Skip to content

Support/fix for star-tree keyword aggregation dfs mode#18354

Merged
sachinpkale merged 1 commit intoopensearch-project:mainfrom
sandeshkr419:dfs
Jun 5, 2025
Merged

Support/fix for star-tree keyword aggregation dfs mode#18354
sachinpkale merged 1 commit intoopensearch-project:mainfrom
sandeshkr419:dfs

Conversation

@sandeshkr419
Copy link
Copy Markdown
Member

@sandeshkr419 sandeshkr419 commented May 22, 2025

Description

TLDR: DFS flow in keyword terms was returing empty buckets, this PR fixes the flow for DFS case.

Detailed Explanation of Changes:
The existing strategy where we fetch which bucketOrd to update:

long bucketOrd = collectionStrategy.globalOrdToBucketOrd(0, ord);

For DenseGlobalOrds (used by breadth-first flow) implementation: would return the bucket in for correctly

 @Override
        long globalOrdToBucketOrd(long owningBucketOrd, long globalOrd) {
            assert owningBucketOrd == 0;
            return globalOrd;
        }
        

For RemapGlobalOrds (used by depth-first flow) implementation: was returning -1 when it was trying to find a bucket, and hence bucket was not getting initialized properly with correct values.

@Override
        long globalOrdToBucketOrd(long owningBucketOrd, long globalOrd) {
            return bucketOrds.find(owningBucketOrd, globalOrd);
        }

We needed a new utility to find or create bucket if not available so I have introduced a new utility to resolve the same:

 abstract long getOrAddBucketOrd(long owningBucketOrd, long globalOrd) throws IOException;

This change ensures that both the cases. bfs/dfs are handled correctly.

Added test cases to handle the same.

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

@github-actions
Copy link
Copy Markdown
Contributor

✅ Gradle check result for d4f6597: SUCCESS

@codecov
Copy link
Copy Markdown

codecov bot commented May 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.53%. Comparing base (631bed4) to head (cd9c5be).
Report is 38 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #18354      +/-   ##
============================================
- Coverage     72.53%   72.53%   -0.01%     
- Complexity    67396    67448      +52     
============================================
  Files          5492     5492              
  Lines        311127   311128       +1     
  Branches      45224    45223       -1     
============================================
- Hits         225680   225674       -6     
- Misses        67063    67131      +68     
+ Partials      18384    18323      -61     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sandeshkr419 sandeshkr419 marked this pull request as ready for review May 29, 2025 18:20
@sandeshkr419 sandeshkr419 changed the title Support for star-tree keyword aggregation dfs mode Support/fix for star-tree keyword aggregation dfs mode May 29, 2025
Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for cd9c5be:

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?

Copy link
Copy Markdown
Contributor

@bharath-techie bharath-techie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are not deferring, can you please raise an issue to do benchmarks ?

@sandeshkr419 sandeshkr419 reopened this Jun 5, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 5, 2025

❕ Gradle check result for cd9c5be: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@sachinpkale sachinpkale merged commit e417086 into opensearch-project:main Jun 5, 2025
56 of 58 checks passed
@sandeshkr419 sandeshkr419 deleted the dfs branch June 5, 2025 16:16
@sandeshkr419 sandeshkr419 added the bug Something isn't working label Jun 5, 2025
Gagan6164 pushed a commit to Gagan6164/OpenSearch that referenced this pull request Jun 8, 2025
…t#18354)

Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
Gagan6164 pushed a commit to Gagan6164/OpenSearch that referenced this pull request Jun 8, 2025
…t#18354)

Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
abhita pushed a commit to abhita/OpenSearch that referenced this pull request Jun 9, 2025
…t#18354)

Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
neuenfeldttj pushed a commit to neuenfeldttj/OpenSearch that referenced this pull request Jun 26, 2025
…t#18354)

Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>Signed-off-by: TJ Neuenfeldt <tjneu@amazon.com>
neuenfeldttj pushed a commit to neuenfeldttj/OpenSearch that referenced this pull request Jun 26, 2025
…t#18354)

Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
tandonks pushed a commit to tandonks/OpenSearch that referenced this pull request Aug 5, 2025
…t#18354)

Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants