-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Fix casting of scaled_float in sorts #57207
Fix casting of scaled_float in sorts #57207
Conversation
Previously we'd get a `ClassCastException` when you tried to use `numeric_type` on `scaled_float`. Oops! This cleans up the CCE and moves some code around so the casting actually works.
Pinging @elastic/es-search (:Search/Search) |
It'd be super reasonable for you to ask "why in the world would you want to cast a |
@elasticmachine, run elasticsearch-ci/2 |
this makes sense to me but I think we should find a reviewer who's more familiar with mappings code than me :) maybe @romseygeek ? |
So pinged! |
This isn't a bit of mappings that I know a lot about, alas - somebody who knows more about aggs than me is probably a better bet... |
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.
Left a comment but otherwise LGTM. I'm far from an expert in this area of the code either, so grain of salt :)
return comparatorSource(targetNumericType, missingValue, sortMode, nested) | ||
.newBucketedSort(bigArrays, sortOrder, format, bucketSize, extra); | ||
protected boolean sortRequiresCustomComparator() { | ||
return numericType == NumericType.HALF_FLOAT; |
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.
Maybe leave a comment in here about why half_floats need a custom comparator? I'm assuming their encoding makes them non-ordered or something?
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.
I believe that is so. I'll dig and leave 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, nice cleanup
@@ -97,8 +97,28 @@ setup: | |||
|
|||
- do: | |||
search: | |||
rest_total_hits_as_int: true |
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.
thanks
Previously we'd get a `ClassCastException` when you tried to use `numeric_type` on `scaled_float`. Oops! This cleans up the CCE and moves some code around so the casting actually works.
Previously we'd get a
ClassCastException
when you tried to usenumeric_type
onscaled_float
. Oops! This cleans up the CCE and movessome code around so the casting actually works.