You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ri...@apache.org on 2022/11/04 12:33:38 UTC

[pinot] 01/01: upgrade RoaringBitmap and revert workaround for bug

This is an automated email from the ASF dual-hosted git repository.

richardstartin pushed a commit to branch rgs/rangebitmap-upgrade-and-fix
in repository https://gitbox.apache.org/repos/asf/pinot.git

commit 61448cb1588c140239725e5d29afeba1436f1aef
Author: Richard Startin <ri...@datadoghq.com>
AuthorDate: Fri Nov 4 12:09:11 2022 +0000

    upgrade RoaringBitmap and revert workaround for bug
---
 LICENSE-binary                                       |  4 ++--
 .../index/readers/BitSlicedRangeIndexReader.java     | 20 +++-----------------
 pom.xml                                              |  2 +-
 3 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/LICENSE-binary b/LICENSE-binary
index a8fd7eb074..beeb300fd5 100644
--- a/LICENSE-binary
+++ b/LICENSE-binary
@@ -453,8 +453,8 @@ org.jetbrains:annotations:13.0
 org.lz4:lz4-java:1.8.0
 org.objenesis:objenesis:2.1
 org.quartz-scheduler:quartz:2.3.2
-org.roaringbitmap:RoaringBitmap:0.9.28
-org.roaringbitmap:shims:0.9.28
+org.roaringbitmap:RoaringBitmap:0.9.35
+org.roaringbitmap:shims:0.9.35
 org.scala-lang.modules:scala-collection-compat_2.12:2.3.0
 org.scala-lang.modules:scala-java8-compat_2.12:0.9.1
 org.scala-lang.modules:scala-xml_2.12:1.3.0
diff --git a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/BitSlicedRangeIndexReader.java b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/BitSlicedRangeIndexReader.java
index 9a47ad7494..0fde2d9ddc 100644
--- a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/BitSlicedRangeIndexReader.java
+++ b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/BitSlicedRangeIndexReader.java
@@ -160,14 +160,7 @@ public class BitSlicedRangeIndexReader implements RangeIndexReader<ImmutableRoar
     RangeBitmap rangeBitmap = mapRangeBitmap();
     if (Long.compareUnsigned(max, columnMax) < 0) {
       if (Long.compareUnsigned(min, 0) > 0) {
-        // TODO: RangeBitmap has a bug in version 0.9.28 which gives wrong result computing between for 2 numbers with
-        //       different sign. The bug is tracked here: https://github.com/RoaringBitmap/RoaringBitmap/issues/586.
-        //       This is a work-around for the bug.
-        if (columnMax > 0) {
-          return rangeBitmap.between(min, max).toMutableRoaringBitmap();
-        } else {
-          return rangeBitmap.gte(min, rangeBitmap.lte(max)).toMutableRoaringBitmap();
-        }
+        return rangeBitmap.between(min, max).toMutableRoaringBitmap();
       }
       return rangeBitmap.lte(max).toMutableRoaringBitmap();
     } else {
@@ -175,7 +168,7 @@ public class BitSlicedRangeIndexReader implements RangeIndexReader<ImmutableRoar
         return rangeBitmap.gte(min).toMutableRoaringBitmap();
       }
       MutableRoaringBitmap all = new MutableRoaringBitmap();
-      all.add(0, _numDocs);
+      all.add(0L, _numDocs);
       return all;
     }
   }
@@ -184,14 +177,7 @@ public class BitSlicedRangeIndexReader implements RangeIndexReader<ImmutableRoar
     RangeBitmap rangeBitmap = mapRangeBitmap();
     if (Long.compareUnsigned(max, columnMax) < 0) {
       if (Long.compareUnsigned(min, 0) > 0) {
-        // TODO: RangeBitmap has a bug in version 0.9.28 which gives wrong result computing between for 2 numbers with
-        //       different sign. The bug is tracked here: https://github.com/RoaringBitmap/RoaringBitmap/issues/586.
-        //       This is a work-around for the bug.
-        if (columnMax > 0) {
-          return (int) rangeBitmap.betweenCardinality(min, max);
-        } else {
-          return (int) rangeBitmap.gteCardinality(min, rangeBitmap.lte(max));
-        }
+        return (int) rangeBitmap.betweenCardinality(min, max);
       }
       return (int) rangeBitmap.lteCardinality(max);
     } else {
diff --git a/pom.xml b/pom.xml
index 151c154912..79fb0b283e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -442,7 +442,7 @@
       <dependency>
         <groupId>org.roaringbitmap</groupId>
         <artifactId>RoaringBitmap</artifactId>
-        <version>0.9.28</version>
+        <version>0.9.35</version>
       </dependency>
       <dependency>
         <groupId>com.101tec</groupId>


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