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

Refactor extendedBounds to use DoubleBounds #60556

Merged
merged 4 commits into from
Aug 4, 2020

Conversation

imotov
Copy link
Contributor

@imotov imotov commented Jul 31, 2020

Refactors extendedBounds to use DoubleBounds instead
of 2 variables.

This is a follow up for #59175

Refactors extendedBounds to use DoubleBounds instead
of 2 variables.

This is a follow up for elastic#59175
@imotov imotov added v7.10.0 and removed WIP labels Aug 3, 2020
@imotov imotov marked this pull request as ready for review August 3, 2020 16:58
@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 Aug 3, 2020
@imotov imotov requested a review from not-napoleon August 3, 2020 16:58
Copy link
Member

@not-napoleon not-napoleon left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for cleaning this up.

@@ -100,7 +97,10 @@ public AbstractHistogramAggregator(

EmptyBucketInfo emptyBucketInfo = null;
if (minDocCount == 0) {
emptyBucketInfo = new EmptyBucketInfo(interval, offset, minBound, maxBound, buildEmptySubAggregations());
emptyBucketInfo = new EmptyBucketInfo(interval, offset,
extendedBounds == null || extendedBounds.getMin() == null ? Double.POSITIVE_INFINITY : extendedBounds.getMin(),
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Could we provide a default DoubleBounds(null, null) in the constructor, and then just call DoubleBounds#effectiveMin here? (ditto for max and the below usage). Especially since the logic for what to use for undefined is a little arbitrary (e.g. it's not obvious at a glance why we use POSITIVE_INFINITY instead of NAN), I'd rather just keep that logic in one place if possible.

@imotov imotov merged commit bfc62a4 into elastic:master Aug 4, 2020
imotov added a commit to imotov/elasticsearch that referenced this pull request Aug 4, 2020
Refactors extendedBounds to use DoubleBounds instead
of 2 variables.

This is a follow up for elastic#59175
imotov added a commit that referenced this pull request Aug 4, 2020
Refactors extendedBounds to use DoubleBounds instead
of 2 variables.

This is a follow up for #59175
@imotov imotov deleted the refactor-bounds branch August 5, 2020 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >refactoring Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v7.10.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants