-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Aggregation key can't be number #56402
Comments
Pinging @elastic/es-analytics-geo (:Analytics/Aggregations) |
Please could somebody @elastic/es-analytics-geo have a look and verify whether limiting range keys to strings is a bug or rather a conscious decision? |
@polyfractal what do you think about this? I don't know enough about keys to have an opinion. |
I believe this is just a quirk of the old-style pull parser that Range still uses. If the token is a string, we check if it is potentially a It would be fairly trivial to cast a numeric Note: We'll still need to return the key as a string, because default keys include the range ( |
Gotcha! |
This adds support for parsing numbers as range keys. They get converted into a string, but we allow numbers. While I was there I replaced the parser for `Range` with a `ConstructingObjectParser` which will automatically add support for "did you mean" style corrections on errors. Closes elastic#56402
This adds support for parsing numbers as range keys. They get converted into a string, but we allow numbers. While I was there I replaced the parser for `Range` with a `ConstructingObjectParser` which will automatically add support for "did you mean" style corrections on errors. Closes #56402
This adds support for parsing numbers as range keys. They get converted into a string, but we allow numbers. While I was there I replaced the parser for `Range` with a `ConstructingObjectParser` which will automatically add support for "did you mean" style corrections on errors. Closes elastic#56402
This adds support for parsing numbers as range keys. They get converted into a string, but we allow numbers. While I was there I replaced the parser for `Range` with a `ConstructingObjectParser` which will automatically add support for "did you mean" style corrections on errors. Closes #56402
@rightaway I've landed this change in 7.x which will become 7.9.0. |
Elasticsearch version (
bin/elasticsearch --version
): 7.6.2Plugins installed: []
JVM version (
java -version
): 13.0.2OS version (
uname -a
if on a Unix-like system): archlinuxDescription of the problem including expected versus actual behavior:
If you use a numeric key for a range aggregation you get an error. But string key works fine. Numeric keys should be accepted and turned into strings instead of failing.
Steps to reproduce:
Provide logs (if relevant):
The text was updated successfully, but these errors were encountered: