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

Avoid precision loss in DocValueFormat.RAW#parseLong #49063

Merged
merged 1 commit into from
Nov 15, 2019
Merged

Avoid precision loss in DocValueFormat.RAW#parseLong #49063

merged 1 commit into from
Nov 15, 2019

Conversation

tjwilson90
Copy link
Contributor

fixes #38692

@cbuescher cbuescher added the :Analytics/Aggregations Aggregations label Nov 14, 2019
@elasticmachine
Copy link
Collaborator

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

@polyfractal
Copy link
Contributor

@not-napoleon you might have a better handle on this area than me, would you mind reviewing? ❤️

@not-napoleon
Copy link
Member

@elasticmachine test this please

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.

This looks fine to me, but I do wonder if there was some reason we weren't doing this in the first place. @jpountz I think you originally wrote this, do you know of some reason we wouldn't want to try parsing as a long first before falling back to rounding?

expectThrows(IllegalArgumentException.class, () -> DocValueFormat.RAW.parseLong("", randomBoolean(), null));
expectThrows(IllegalArgumentException.class, () -> DocValueFormat.RAW.parseLong("abc", randomBoolean(), null));
expectThrows(IllegalArgumentException.class, () -> DocValueFormat.RAW.parseDouble("", randomBoolean(), null));
expectThrows(IllegalArgumentException.class, () -> DocValueFormat.RAW.parseDouble("abc", randomBoolean(), null));
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch, thanks!

@jpountz
Copy link
Contributor

jpountz commented Nov 14, 2019

@not-napoleon No good reason, this is a true bug. :)

@not-napoleon
Copy link
Member

@elasticmachine run elasticsearch-ci/1

@tjwilson90
Copy link
Contributor Author

The 6.8 branch is still maintained, right? Could this fix be backported to that branch as well please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Precision loss of include/exclude filter values in terms aggregation
8 participants