Skip to content

Commit 91d7bcb

Browse files
branch-4.0: [Chore](bitmap) change BitmapValue CHECK to throw exception #59464 (#59491)
Cherry-picked from #59464 Co-authored-by: Pxl <[email protected]>
1 parent 1e89124 commit 91d7bcb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

be/src/util/bitmap_value.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,12 +1977,19 @@ class BitmapValue {
19771977
++src;
19781978
uint8_t count = *src;
19791979
++src;
1980-
CHECK(count <= SET_TYPE_THRESHOLD) << "bitmap value with incorrect set count";
1980+
if (count > SET_TYPE_THRESHOLD) {
1981+
throw Exception(ErrorCode::INTERNAL_ERROR,
1982+
"bitmap value with incorrect set count, count: {}", count);
1983+
}
19811984
_set.reserve(count);
19821985
for (uint8_t i = 0; i != count; ++i, src += sizeof(uint64_t)) {
19831986
_set.insert(decode_fixed64_le(reinterpret_cast<const uint8_t*>(src)));
19841987
}
1985-
CHECK_EQ(count, _set.size()) << "bitmap value with incorrect set count";
1988+
if (_set.size() != count) {
1989+
throw Exception(ErrorCode::INTERNAL_ERROR,
1990+
"bitmap value with incorrect set count, count: {}, set size: {}",
1991+
count, _set.size());
1992+
}
19861993

19871994
if (!config::enable_set_in_bitmap_value) {
19881995
_prepare_bitmap_for_write();

0 commit comments

Comments
 (0)