You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/09/15 13:54:26 UTC

[GitHub] [pinot] richardstartin opened a new issue #7436: Range index does not create buckets correctly for `FLOAT` columns

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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] richardstartin commented on issue #7436: Range index does not create buckets correctly for `FLOAT` columns

Posted by GitBox <gi...@apache.org>.
richardstartin commented on issue #7436:
URL: https://github.com/apache/pinot/issues/7436#issuecomment-921804677


   Fixed by #7435


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] richardstartin closed issue #7436: Range index does not create buckets correctly for `FLOAT` columns

Posted by GitBox <gi...@apache.org>.
richardstartin closed issue #7436:
URL: https://github.com/apache/pinot/issues/7436


   


-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org