-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
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:
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:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
