Skip to content

Cardinality Aggregation dynamic pruning null pointer exception catch #17775

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

Merged
merged 4 commits into from
Apr 11, 2025

Conversation

ajleong623
Copy link
Contributor

@ajleong623 ajleong623 commented Apr 3, 2025

Description

There was a possibility of a null pointer exception error when the BooleanScorer passes in a null document. The document is assumed to not be null, and while that might be true for the DefaultBulkScorer, it is not checked in the BooleanScorer.

Related Issues

Resolves #17739

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 github-actions bot added Search:Aggregations v3.0.0 Issues and PRs related to version 3.0.0 labels Apr 3, 2025
Copy link
Contributor

github-actions bot commented Apr 3, 2025

❕ Gradle check result for 6a94385: 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.

Copy link

codecov bot commented Apr 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 72.39%. Comparing base (8312e42) to head (6a94385).
Report is 71 commits behind head on main.

Files with missing lines Patch % Lines
...ch/aggregations/metrics/CardinalityAggregator.java 0.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #17775      +/-   ##
============================================
- Coverage     72.51%   72.39%   -0.13%     
+ Complexity    66142    66062      -80     
============================================
  Files          5356     5356              
  Lines        306421   306425       +4     
  Branches      44393    44395       +2     
============================================
- Hits         222192   221824     -368     
- Misses        66024    66487     +463     
+ Partials      18205    18114      -91     

☔ 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.

@bowenlan-amzn
Copy link
Member

@jainankitk, @andrross could we merge this in for 3.0? We couldn't reproduce the NPE with real data, so currently we cannot easily cover the added null check.

Copy link
Contributor

@jainankitk jainankitk left a comment

Choose a reason for hiding this comment

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

While having bug fix without accompanying unit test is not ideal, I don't see any harm in having these checks to avoid any potential NPEs

@jainankitk jainankitk merged commit bc50da2 into opensearch-project:main Apr 11, 2025
57 of 60 checks passed
rgsriram pushed a commit to rgsriram/OpenSearch that referenced this pull request Apr 15, 2025
…#17775)

* Update CardinalityAggregator.java

Signed-off-by: ajleong623 <[email protected]>

* Signed-off-by: Anthony Leong <[email protected]>

Signed-off-by: ajleong623 <[email protected]>

* Update CardinalityAggregator.java

Signed-off-by: ajleong623 <[email protected]>

* Checked Cardinality Aggregation dynamic pruning null pointer exception Signed-off-by: Anthony Leong <[email protected]>

Signed-off-by: ajleong623 <[email protected]>

---------

Signed-off-by: ajleong623 <[email protected]>
Signed-off-by: Sriram Ganesh <[email protected]>
Harsh-87 pushed a commit to Harsh-87/OpenSearch that referenced this pull request May 7, 2025
…#17775)

* Update CardinalityAggregator.java

Signed-off-by: ajleong623 <[email protected]>

* Signed-off-by: Anthony Leong <[email protected]>

Signed-off-by: ajleong623 <[email protected]>

* Update CardinalityAggregator.java

Signed-off-by: ajleong623 <[email protected]>

* Checked Cardinality Aggregation dynamic pruning null pointer exception Signed-off-by: Anthony Leong <[email protected]>

Signed-off-by: ajleong623 <[email protected]>

---------

Signed-off-by: ajleong623 <[email protected]>
Signed-off-by: Harsh Kothari <[email protected]>
Harsh-87 pushed a commit to Harsh-87/OpenSearch that referenced this pull request May 7, 2025
…#17775)

* Update CardinalityAggregator.java

Signed-off-by: ajleong623 <[email protected]>

* Signed-off-by: Anthony Leong <[email protected]>

Signed-off-by: ajleong623 <[email protected]>

* Update CardinalityAggregator.java

Signed-off-by: ajleong623 <[email protected]>

* Checked Cardinality Aggregation dynamic pruning null pointer exception Signed-off-by: Anthony Leong <[email protected]>

Signed-off-by: ajleong623 <[email protected]>

---------

Signed-off-by: ajleong623 <[email protected]>
Signed-off-by: Harsh Kothari <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Search:Aggregations skip-changelog v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cardinality Aggregation dynamic pruning null pointer exception
3 participants