Skip to content

Avoid precision loss in DocValueFormat.RAW#parseLong#49063

Merged
not-napoleon merged 1 commit intoelastic:masterfrom
tjwilson90:master
Nov 15, 2019
Merged

Avoid precision loss in DocValueFormat.RAW#parseLong#49063
not-napoleon merged 1 commit intoelastic:masterfrom
tjwilson90:master

Conversation

@tjwilson90
Copy link
Copy Markdown
Contributor

fixes #38692

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

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

@polyfractal
Copy link
Copy Markdown
Contributor

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

@not-napoleon
Copy link
Copy Markdown
Member

@elasticmachine test this please

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

jpountz commented Nov 14, 2019

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

@not-napoleon
Copy link
Copy Markdown
Member

@elasticmachine run elasticsearch-ci/1

@tjwilson90
Copy link
Copy Markdown
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