-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[Transform] add support for unsigned_long data type #63940
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
Conversation
writing out integer results properly, because coerce is not supported for unsigned_long fixes elastic#63871
|
Pinging @elastic/ml-core (:ml/Transform) |
| * @param value the value as double (aggs return double for everything) | ||
| * @return value if its floating point, a integer | ||
| */ | ||
| public static Object convertToIntegerTypeIfNeeded(String type, double value) { |
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.
| public static Object convertToIntegerTypeIfNeeded(String type, double value) { | |
| public static Object convertToDiscreteNumeralTypeIfNeeded(String type, double value) { |
Or some better name as this is is not an integer but instead some possibly large discrete numeral (big int or a long).
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.
its referring to the mathematical definition of integer, that's why integer type, not integer. I can try to find a better name, maybe dropFloatingPointComponentIfNeeded, but lets not over-complicate it, the doc string defines what it does.
| if (NUMERIC_FIELD_MAPPER_TYPES.getOrDefault(type, true) == false) { | ||
| assert value % 1 == 0; | ||
| if (value < Long.MAX_VALUE) { | ||
| return (long) value; | ||
| } | ||
|
|
||
| // special case for unsigned long | ||
| return BigDecimal.valueOf(value).toBigInteger(); |
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.
Its weird to me that there is not a blanket map doc value -> indexable value :(
This works in a pinch, I wonder if there is anyway to use DocValueFormat.UNSIGNED_LONG_SHIFTED.
But looking at it, there isn't a clean cut solution :/
add support for unsigned_long, which required a change in writing out integer results properly, because coerce is not supported for unsigned_long
add support for unsigned_long, which required a change in writing out integer results properly, because coerce is not supported for unsigned_long fixes elastic#63871
add support for unsigned_long, which required a change in
writing out integer results properly, because coerce is not
supported for unsigned_long
fixes #63871