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
Aggregations parsing is too lenient. #5837
Conversation
it looks cleaner now and good to me but I guess I'll let @uboness take a look at well! |
Would be great if this could be expanded to include the usual parsing problems, like doubling up fields. For example:
This agg will only use the |
I agree this should not fail silently. I think the best way to fix this issue would be to wrap the parser in order to make sure that objects don't contain duplicate keys. |
@jpountz I like the idea of having a parser wrapper that ensures we have unique keys. Yet, that is a general thing and should be a different issue? |
+1 on a different issue |
been thinking about it (dup keys that is)... not sure about it... wrapping the parser to check that in a generic manner comes with a cost (keeping track of all keys)... I'm wondering if it's something we should just keep simple and as cheap as possible at the price of leniency |
.endObject() | ||
.endObject()).execute().actionGet(); | ||
} | ||
|
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.
can we also add a test for:
- agg type is missing
- 2 agg types definitions
- 2 "aggs" definitions
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.
There is already a test for "2 agg types", I'll add the 2 other ideas.
left a comment on missing tests... other than that, LGTM |
Our parser currently accepts invalid aggregations definitions, this might trigger unexpected results like #5827.
Close #5827