Skip to content

Conversation

@tlrx
Copy link
Member

@tlrx tlrx commented Apr 18, 2017

Some aggregations (like Min, Max etc) use a wrong DocValueFormat in
tests (like IP or GeoHash). We should not test aggregations that expect
a numeric value with a DocValueFormat like IP. Such wrong DocValueFormat
can also prevent the aggregation to be rendered as ToXContent, and this
will be an issue for the High Level Rest Client tests which expect to be
able to parse back aggregations.

Some aggregations (like Min, Max etc) use a wrong DocValueFormat in
tests (like IP or GeoHash). We should not test aggregations that expect
a numeric value with a DocValueFormat like IP. Such wrong DocValueFormat
can also prevent the aggregation to be rendered as ToXContent, and this
will be an issue for the High Level Rest Client tests which expect to be
able to parse back aggregations.
@tlrx tlrx added :Analytics/Aggregations Aggregations review >test Issues or PRs that are addressing/adding tests v5.4.0 v6.0.0-alpha1 labels Apr 18, 2017
@tlrx tlrx requested a review from colings86 April 18, 2017 11:02
protected static DocValueFormat randomNumericDocValueFormat() {
final List<Supplier<DocValueFormat>> formats = new ArrayList<>(3);
formats.add(() -> DocValueFormat.RAW);
formats.add(() -> DocValueFormat.BOOLEAN);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a numeric doc value format?

Copy link
Member Author

Choose a reason for hiding this comment

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

I kept this one because it was used in many aggregations tests before and seems to be supported (true/false are translated to 1/0) by aggregations that work on numeric. I'm not sure it makes much sense though. Would you like to see it removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm not sure, it does seem a bit weird to be there so I'm leaning towards "remove it". It doesn't feel like a great idea to be running numeric aggregations on a boolean field and I don't know if its something that works by design or just happens to work right now and might break in the future. /cc @jpountz who might have thoughts on that

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it just happens to work today and might break in the future indeed.

Copy link
Contributor

Choose a reason for hiding this comment

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

In which case I would say remove the BOOLEAN format here since its not actually a numeric format

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, done.

Copy link
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

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

LGTM

@tlrx tlrx merged commit 829dd06 into elastic:master Apr 18, 2017
@tlrx tlrx deleted the use-correct-docvalueformats branch April 18, 2017 15:04
@tlrx tlrx removed the v5.4.0 label Apr 18, 2017
@tlrx
Copy link
Member Author

tlrx commented Apr 18, 2017

Thanks @colings86

javanna pushed a commit to javanna/elasticsearch that referenced this pull request May 23, 2017
…#24155)

Some aggregations (like Min, Max etc) use a wrong DocValueFormat in
tests (like IP or GeoHash). We should not test aggregations that expect
a numeric value with a DocValueFormat like IP. Such wrong DocValueFormat
can also prevent the aggregation to be rendered as ToXContent, and this
will be an issue for the High Level Rest Client tests which expect to be
able to parse back aggregations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Aggregations Aggregations >test Issues or PRs that are addressing/adding tests v6.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants