Skip to content

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.

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