[fix] fix bitmap wrong result (#8478)
Fix a bug when query bitmap return wrong result, even the simplest query. Such as ``` CREATE TABLE `pv_bitmap_fix2` ( `dt` int(11) NULL COMMENT "", `page` varchar(10) NULL COMMENT "", `user_id_bitmap` bitmap BITMAP_UNION NULL COMMENT "" ) ENGINE=OLAP AGGREGATE KEY(`dt`, `page`) COMMENT "OLAP" DISTRIBUTED BY HASH(`dt`) BUCKETS 2 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "in_memory" = "false", "storage_format" = "V2" ) Insert any hundreds of rows of data select count(distinct user_id_bitmap) from pv_bitmap_fix2 the result is wrong ``` This is a bug of vectorization of storage layer.
This commit is contained in:
@ -63,11 +63,11 @@ public:
|
||||
}
|
||||
|
||||
void insert_many_binary_data(char* data_array, uint32_t* len_array, uint32_t* start_offset_array, size_t num) override {
|
||||
resize(num);
|
||||
if constexpr (std::is_same_v<T, BitmapValue>) {
|
||||
for (size_t i = 0; i < num; i++) {
|
||||
uint32_t len = len_array[i];
|
||||
uint32_t start_offset = start_offset_array[i];
|
||||
insert_default();
|
||||
BitmapValue* pvalue = &get_element(size() - 1);
|
||||
if (len != 0) {
|
||||
BitmapValue value;
|
||||
@ -81,6 +81,7 @@ public:
|
||||
for (size_t i = 0; i < num; i++) {
|
||||
uint32_t len = len_array[i];
|
||||
uint32_t start_offset = start_offset_array[i];
|
||||
insert_default();
|
||||
HyperLogLog* pvalue = &get_element(size() - 1);
|
||||
if (len != 0) {
|
||||
HyperLogLog value;
|
||||
|
||||
Reference in New Issue
Block a user