cambyzju commented on code in PR #19973: URL: https://github.com/apache/doris/pull/19973#discussion_r1205201471
########## be/src/util/bitmap_value.h: ########## @@ -1909,14 +2446,28 @@ class BitmapValue { void _convert_to_smaller_type() { if (_type == BITMAP) { uint64_t c = _bitmap->cardinality(); - if (c > 1) return; + if (config::enable_set_in_bitmap_value && c > SET_TYPE_THRESHOLD) { + return; + } else if (c > 1) { + return; + } if (c == 0) { _type = EMPTY; - } else { + } else if (c == 1) { _type = SINGLE; _sv = _bitmap->minimum(); + } else { + _type = SET; + for (auto v : *_bitmap) { + _set.insert(v); + } } _bitmap.reset(); + } else if (_type == SET) { + if (_set.size() == 1) { + _type = SINGLE; + _sv = *_set.begin(); + } Review Comment: else if set.size == 0? -- 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