Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion be/src/util/bitmap_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,7 @@ class BitmapValue {

// Return how many bytes are required to serialize this bitmap.
// See BitmapTypeCode for the serialized format.
size_t getSizeInBytes() const {
size_t getSizeInBytes() {
size_t res = 0;
switch (_type) {
case EMPTY:
Expand All @@ -2186,6 +2186,7 @@ class BitmapValue {
}
break;
case BITMAP:
_prepare_bitmap_for_write();
_bitmap->runOptimize();
_bitmap->shrinkToFit();
res = _bitmap->getSizeInBytes(config::bitmap_serialize_version);
Expand Down
3 changes: 2 additions & 1 deletion be/src/vec/data_types/data_type_bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ void DataTypeBitMap::to_string(const IColumn& column, size_t row_num, BufferWrit
ColumnPtr ptr = result.first;
row_num = result.second;

const auto& data = assert_cast<const ColumnBitmap&>(*ptr).get_element(row_num);
auto& data =
const_cast<BitmapValue&>(assert_cast<const ColumnBitmap&>(*ptr).get_element(row_num));
std::string buffer(data.getSizeInBytes(), '0');
data.write_to(const_cast<char*>(buffer.data()));
ostr.write(buffer.c_str(), buffer.size());
Expand Down
Loading