Skip to content
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

Resolve minbound maxbound NullPointerException #64091

Merged

Conversation

alishahusain
Copy link
Contributor

@alishahusain alishahusain commented Oct 23, 2020

This PR resolves the NullPointerException when min/max bounds are set to null by returning -/+ Infinity

@@ -194,11 +194,17 @@ public HistogramAggregationBuilder offset(double offset) {

/** Get the current minimum bound that is set on this builder. */
public double minBound() {
if (extendedBounds.getMin() == null) {
return Double.NEGATIVE_INFINITY;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be other way around: POSITIVE_INFINITY for min and NEGATIVE_INFiNITY for max. Otherwise specifying null extended bounds would mean we want bounds to extend bounds to the entire range. This should be also consistent with the behaviour which was before this issues was introduced in #60556.

Please also note that extendedBounds themselves can be null, so I would suggest using DoubleBounds#getEffectiveMin instead.

@imotov
Copy link
Contributor

imotov commented Oct 28, 2020

@elasticmachine test this please

@imotov
Copy link
Contributor

imotov commented Oct 28, 2020

@elasticmachine update branch

@imotov
Copy link
Contributor

imotov commented Oct 28, 2020

@elasticmachine test this please

@imotov
Copy link
Contributor

imotov commented Oct 29, 2020

@elasticmachine run elasticsearch-ci/packaging-sample-unix

Copy link
Contributor

@imotov imotov left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you for the contribution and working patiently on improving the PR!

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (:Analytics/Aggregations)

@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Oct 29, 2020
@imotov imotov changed the title Resolve minbound maxbound NullPointerException Issue #62934 Resolve minbound maxbound NullPointerException Oct 29, 2020
@imotov imotov merged commit a9d4819 into elastic:master Oct 29, 2020
imotov pushed a commit to imotov/elasticsearch that referenced this pull request Oct 29, 2020
Resolved nullPointerException in minbound and maxbound methods.

Fixes elastic#62934
imotov added a commit that referenced this pull request Oct 29, 2020
Resolved nullPointerException in minbound and maxbound methods.

Fixes #62934

Co-authored-by: Alisha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v7.11.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants