Skip to content

Commit

Permalink
[Bug](bitmap) clear set when bitmap fastunion (apache#37816)
Browse files Browse the repository at this point in the history
## Proposed changes
before:6 min 59.33 sec
after   :24.67 sec
  • Loading branch information
BiteTheDDDDt authored Jul 15, 2024
1 parent b8b36c6 commit 01f00aa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions be/src/util/bitmap_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -1252,8 +1252,7 @@ class BitmapValue {
std::vector<const detail::Roaring64Map*> bitmaps;
std::vector<uint64_t> single_values;
std::vector<const SetContainer<uint64_t>*> sets;
for (int i = 0; i < values.size(); ++i) {
auto* value = values[i];
for (const auto* value : values) {
switch (value->_type) {
case EMPTY:
break;
Expand All @@ -1280,7 +1279,9 @@ class BitmapValue {
_bitmap->add(_sv);
break;
case BITMAP:
*_bitmap |= detail::Roaring64Map::fastunion(bitmaps.size(), bitmaps.data());
for (const auto* bitmap : bitmaps) {
*_bitmap |= *bitmap;
}
break;
case SET: {
*_bitmap = detail::Roaring64Map::fastunion(bitmaps.size(), bitmaps.data());
Expand Down Expand Up @@ -1315,6 +1316,7 @@ class BitmapValue {
_bitmap->add(v);
}
_type = BITMAP;
_set.clear();
break;
case SET: {
break;
Expand Down

0 comments on commit 01f00aa

Please sign in to comment.