You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/11/01 02:50:47 UTC

[GitHub] [incubator-doris] xinyiZzz commented on a change in pull request #6917: [Function] add BE bitmap function bitmap_subset_in_range

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



##########
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:
       If range_start is greater than bitmap max, count will be equal to 0, and finally an empty string will be output, whether to unified into "null"




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

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



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