qidaye commented on a change in pull request #6917:
URL: https://github.com/apache/incubator-doris/pull/6917#discussion_r739930721



##########
File path: be/src/util/bitmap_value.h
##########
@@ -1451,6 +1451,26 @@ class BitmapValue {
         }
     }
 
+    /**
+     * Return new set with specified range (not include the range_end)
+     */
+    int64_t sub_range(const int64_t& range_start, const int64_t& range_end, 
BitmapValue* ret_bitmap) {
+        int64_t count = 0; 
+        for (auto it = _bitmap.begin(); it != _bitmap.end(); ++it) {
+            if (*it < range_start) {
+                continue;
+            }
+            if (*it < range_end) {
+                ret_bitmap->add(*it);
+                ++count;
+            } else {
+                break;
+            }
+        }
+        return count;

Review comment:
       When there is a error, it returns `null`. The case `range_start` greater 
than `bitmap_max` is a normal case, I think it's ok to return an empty result.




-- 
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-unsubscr...@doris.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to