@@ -1321,7 +1321,7 @@ std::shared_ptr<roaring::Roaring> DeleteBitmap::get_agg(const BitmapKey& bmk) co
1321
1321
handle == nullptr
1322
1322
? nullptr
1323
1323
: reinterpret_cast <AggCache::Value*>(_agg_cache->repr ()->value (handle));
1324
- Cache::Handle * handle2 = nullptr ;
1324
+ // Cache::Handle* handle2 = nullptr;
1325
1325
// FIXME: do we need a mutex here to get rid of duplicated initializations
1326
1326
// of cache entries in some cases?
1327
1327
if (val == nullptr ) { // Renew if needed, put a new Value to cache
@@ -1331,12 +1331,14 @@ std::shared_ptr<roaring::Roaring> DeleteBitmap::get_agg(const BitmapKey& bmk) co
1331
1331
BitmapKey agg_bmk = {std::get<0 >(bmk), std::get<1 >(bmk), start_version};
1332
1332
std::string agg_key_str = agg_cache_key (_tablet_id, agg_bmk); // Cache key container
1333
1333
CacheKey agg_key2 (agg_key_str);
1334
- handle2 = _agg_cache->repr ()->lookup (agg_key2);
1334
+ Cache:: Handle * handle2 = _agg_cache->repr ()->lookup (agg_key2);
1335
1335
if (handle2 == nullptr ) {
1336
1336
start_version = 0 ;
1337
1337
// val = new AggCache::Value();
1338
1338
} else {
1339
- val = reinterpret_cast <AggCache::Value*>(_agg_cache->repr ()->value (handle2));
1339
+ auto val2 = reinterpret_cast <AggCache::Value*>(_agg_cache->repr ()->value (handle2));
1340
+ val->bitmap |= val2->bitmap ;
1341
+ _agg_cache->repr ()->release (handle2);
1340
1342
}
1341
1343
LOG (INFO) << " sout: start agg for tablet=" << _tablet_id
1342
1344
<< " , rowset=" << std::get<0 >(bmk).to_string ()
0 commit comments