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... |
polyfractal
left a comment
There was a problem hiding this comment.
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.
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.
I believe that is so. I'll dig and leave a comment.
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
ClassCastExceptionwhen you tried to usenumeric_typeonscaled_float. Oops! This cleans up the CCE and movessome code around so the casting actually works.