-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add parsing methods to Range aggregations #24583
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
Add parsing methods to Range aggregations #24583
Conversation
javanna
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: == false?
cbuescher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I found two edge cases around the range to/from value that might not be covered by tests yet and that might not be working as expected yet. Not entirely sure, but maybe worth taking another close look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be initialized to Double.NEGATIVE_INFINITY. If InternalRange.from is infinite, the "from" field won't be rendered in the xContent and I think the current parser would leave from == 0 in this case. Maybe we should also add tests for those edge cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, thanks! I added some random ranges with infinity values to the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here but with Double.POSITIVE_INFINITY?
0879dbf to
13c2d12
Compare
|
@cbuescher I updated the code. Can you please have another look? Thanks |
cbuescher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks @cbuescher @javanna |
This pull request adds the parsing logic to InternalRange, InternalDateRange and InternalGeoDistance aggregations.