richardstartin opened a new issue #7436:
URL: https://github.com/apache/pinot/issues/7436
When there is a range index on a `FLOAT` column, all values may be grouped
under the same bucket whenever all values have the same integer floor value.
This is caused by a bug in persisting the floating point data, where the
value is converted to an integer:
```java
private static class FloatValueBuffer implements NumberValueBuffer {
private final PinotDataBuffer _dataBuffer;
FloatValueBuffer(PinotDataBuffer dataBuffer) {
_dataBuffer = dataBuffer;
}
@Override
public void put(int position, Number value) {
_dataBuffer.putFloat(position << 2, value.intValue()); // oops!
}
@Override
public Number get(int position) {
return _dataBuffer.getFloat(position << 2);
}
@Override
public int compare(Number val1, Number val2) {
return Float.compare(val1.floatValue(), val2.floatValue());
}
}
```
The current test for the `RangeIndexCreator` passes because it uses
`RangeIndexCreator._rangeStartArray` as part of the test set up, so doesn't
catch that `RangeIndexCreator._rangeStartArray` only has one element:
<img width="973" alt="Screenshot 2021-09-15 at 14 46 51"
src="https://user-images.githubusercontent.com/16439049/133445633-5dbbe835-d899-466b-8d12-545668aeaef6.png">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]