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

Modify unsigned_long tests for broader ranges #63782

Merged

Conversation

mayya-sharipova
Copy link
Contributor

UnsignedLongTests for the range agg was using very specific intervals
that double type can not distinguish due to lack of precision:

9.223372036854776000E18 == 9.223372036854775807E18 returns true

If we add the corresponding range query test, it will return different
number of hits than the range agg, as range query unlike range agg
doesn't convert valued to double type, and hence more precise.

This patch make broader ranges for the range agg test (so values
converted to doubles don't loose precision), and hence corresponding
range query will return the same number of hits.

Relates to #60050

UnsignedLongTests for the range agg was  using very specific intervals
that double type can not distinguish due to lack of precision:

9.223372036854776000E18 == 9.223372036854775807E18 returns true

If we add the corresponding range query test, it will return different
number of hits than the range agg, as range query unlike range agg
doesn't convert valued to double type, and hence more precise.

This patch make broader ranges for the range agg test (so values
converted to doubles don't loose precision), and hence corresponding
range query will return the same number of hits.

Relates to elastic#60050
@mayya-sharipova mayya-sharipova added >non-issue >test Issues or PRs that are addressing/adding tests :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.11.0 labels Oct 15, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Oct 15, 2020
Copy link
Member

@cbuescher cbuescher left a comment

Choose a reason for hiding this comment

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

LGTM

@mayya-sharipova mayya-sharipova merged commit a11f2ae into elastic:master Oct 16, 2020
@mayya-sharipova mayya-sharipova deleted the unsigned_long_add_range_test branch October 16, 2020 16:08
mayya-sharipova added a commit that referenced this pull request Oct 16, 2020
UnsignedLongTests for the range agg was  using very specific intervals
that double type can not distinguish due to lack of precision:

9.223372036854776000E18 == 9.223372036854775807E18 returns true

If we add the corresponding range query test, it will return different
number of hits than the range agg, as range query unlike range agg
doesn't convert valued to double type, and hence more precise.

This patch make broader ranges for the range agg test (so values
converted to doubles don't loose precision), and hence corresponding
range query will return the same number of hits.

Relates to #60050
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team >test Issues or PRs that are addressing/adding tests v7.11.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants