Skip to content

Test unrounding half_floats (backport of #70937) #71247

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

Merged
merged 1 commit into from
Apr 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package org.elasticsearch.index.mapper;

import org.apache.lucene.document.HalfFloatPoint;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType;
import org.elasticsearch.index.mapper.NumberFieldTypeTests.OutOfRangeSpec;
Expand Down Expand Up @@ -43,13 +42,6 @@ protected void minimalMapping(XContentBuilder b) throws IOException {

@Override
protected Number randomNumber() {
/*
* The native valueFetcher returns 32 bits of precision but the
* doc values fetcher returns 16 bits of precision. To make it
* all line up we round here instead of in the fetcher. This bug
* is tracked in:
* https://github.com/elastic/elasticsearch/issues/70260
*/
return HalfFloatPoint.sortableShortToHalfFloat(HalfFloatPoint.halfFloatToSortableShort(randomFloat()));
return randomBoolean() ? randomFloat() : randomDoubleBetween(-65504, 65504, true);
}
}